I am doing some debugging in php and I need to take a look at the full headers sent to the server in including the multipart form-data information stored in content disposition.
However apache_request_headers() doesn't return that information.
Any clues?
I am also happy to look at a non php solution if possible
From PHP Docs:
Note: As of PHP 4.3.3 you can use this
function with the NSAPI server module
in Netscape/iPlanet/SunONE webservers,
too.
Make sure that those requirements are met.
You can also get the complete header info with feature-rich httpWatch program out there.
Also not PHP related, but you can see the complete request header along with the responses in any Webkit browser (Safari, Chrome) via the Resources-tab in the developer tool. And for Firefox, there's the FireBug-addon, which offers the same functionality.
Related
Is this possible to take screenshots of windows's screen of client users using a PHP application?
If you want to capture the current client web page, you should look into JS solutions (see this related SO answer):
html2canvas
npm packages with keyword ‘screenshot’
You may also be able to programatically load and render HTML with a GET request, though you will still need to run JavaScript to render the full web page on the server side.
If you mean a screenshot of the actual desktop, I fear only the browser would be able to do it and this is still at an experimental stage, probably due to security concerns:
Chrome desktopCapture extension
MDN Media Capture and Streams API
Can I use media capture?
Edit: Possible duplicate of this question. Some back-end libraries to render a web page:
dompdf (PHP5)
wkhtmltopdf (C++)
I'm in the process of trying to better understand http, more specifically I want to get comfortable working with web based APIs. Some of the documentation I've read for specific API's mention that the API will expect to get an http request in exactly this format, with specific headers and content.
I'm trying to use php cURL, but googling around I haven't found a way (that I understand) simply print my http request to the screen or a text file rather than sending it. I want to make sure that the request I'm constructing looks how I intend it to, rather than just getting back a success or failure message from whatever server the request is sent to. Is there an easy way to do this?
You should try using Fiddler. Fiddler show RESPONSE and REQUEST HEADER. Other than that you can install some extension to your browser that shows HEADER, Firefox does have such extension I think it is called LiveHTTP... sorry didn't remember name.
For web debugging Fiddler is what you need http://fiddler2.com/
I'm using PHP, for web designing.
before loading the page I want to check firebug in installed are not in browser, Is there any function in php else how to find firebug plugins is installed or not.
You can't do this. However, it's possible with JavaScript:
if (window.console && window.console.firebug) {
/* firebug found! */
}
PHP is on server side, I don't think there's method to find the client side plugin info. Unless, you can control the browser, then you can detect and put the info in HTTP request, so that server can know.
I don't think that there are any possibilities to check with PHP, but with JavaScript: finding out if console is available
Not on a normal http request, however you can check it with javascript on the client, then make an ajax to the server with the response and act acording to it. detect firebug with javascript
Since firebug does not expose itself via a request header its presence or absence in unknown to the web server.
You would need some client side js in the page that checks for and then sends the result of window.console.firebug to a php script which then associates that result in a session variable.
I want to read plain/text from an Https server. I have tried various codes php and JavaScripts, but to no success. I tried to send a request using Fiddle HTTP Debugging software with modified user-Agent value and I got a response from the server. When I used JavaScript, the browser Firefox and Chrome always change the user-Agent parameter to default agent. I never got anything from the server.
-Send https POST to mydomain.code.com
-User-Agent must be 'myAgent 1.0'
NOTE: am sending the request from another domain.
What is the best approach for this? Please I need some help here! thanks in anticipation
You won't be able to get around the cross domain restrictions (see same origin policy), at least on the browser side. You'll need to use a proxy of some sort. There is a good description along with sample code here.
When you enter soap servers url in browser, normally it produces blank page. But if memory serves me I saw somewhere something like
Hello, this is our soap service. For
documentation please follow this link.
To get an account, please follow this
link. Blahblah.
How can I do that? (Using PHP SoapServer, if that matters).
I did try to just print everything at the bottom of soap-server-handling php code but in that case soap server doesnt work when called from proper soap client.
The example you saw doing that was probably checking for one or more things in the headers and acting upon what it saw. For example, it could inspect
USER_AGENT
ACCEPT
ACCEPT_ENCODING
etc, etc, etc.
For you to do this in PHP, you will need your check to be run before your SoapServer gets the request. You can access the header values by inspecting $SERVER. Most of them will start with HTTP. To get started just
print_r($_SERVER);
What you want to do is look into WSDL (Web Service Description Language). Languages like .NET produce them for you.