Hello All -
I'm writing a script that ***should be*** sending back the status code for the URL requested.
I'm doing this on my local box as a development test with the following script:
function get_status_code($url) {
$headers = get_headers($url);
return substr($headers[0], 9, 3);
}
$url = 'http://localhost/sangat_test/index.php';
echo get_status_code($url);
But when I try this nothing happens - page just tries to load and load and load.
Any idea what I'm doing wrong? Is it not possible to get/test header information from localhost?
Any guidance greatly appreciated.
Neophyte