Is there a way to print the http header? I want to print realm parameter from the header.
as large parts of the HTTP-Header are generated by the Web-Server after PHP has finished its job, there is no real easy way to do this on the server end. A tool commonly used for that purpose (if you are about debugging) is FireBug, which is a PlugIn for the Firefox web browser. This has this feature (and many more).
.... FireBug, which is a PlugIn for the Firefox web browser ....
Thanx for your replies, I just want to print realm attribute, is there a way to print it inside a script.
The script I want to make to check wireless bullets on/off and the host name (bullet name) but the factory registered the host name in the header inside realm attribute.
Hope you got a hint.
This sounds pretty much like two "servers" are involved. What I am guessing from your description is that you have a web server A connecting to a router (which has a built-in web server B). This scenario is quite different from the original assumption. In this case web server A is acting as a web client towards the router (web server B). In this scenario, you could use the CURL PHP extension to connect to the router and then indeed, you would get all the headers. The CURL extension is described in detail in the PHP documentation. It pretty much resembles to 6 or 7 commands:
$weblink = curl_init("http://your-router/whatever.url");
curl_setopt($weblink, CURLOPT_HEADER, 1); // tell PHP you want to grab headers as well
ob_start(); // turn on output buffering, so you can grab the stuff in a variable
curl_exec(); // this will dump the output data from the URL
$buffer = ob_get_contents(); // put everything into a buffer variable
ob_end_clean(); // turn output buffering off and clean it
curl_close(); // free up the CURL resources
After that piece of code you would see everything returned from the router in the variable $buffer and you could process that as you like. The might be some more curl_setopt statements needed, depending on the counterpart web server B. You can for example set options for username and password.