hello
if i have a page, say thispage.php and wants to check where does the previous page comes from, how can i do it???
any php functions?
$_SERVER['HTTP_REFERER'] returns a value with the previous visited page, but it's not mandatory, and is often empty.
Not to be trusted!
knutm
yes, i tried the following two schemes:
1) print_r ($_SERVER);
2) echo " $_SERVER['HTTP_REFERER'];
and 1) didn't return the whole para value 2) didn't return any value...
is there anything to do with the setting?
what should i do then?
You have syntax errors in your second piece of code...I hope you have error_reporting turned up all the way.
Anyway, if $_SERVER didn't work, try $HTTP_SERVER_VARS. You may be using an older PHP version...
Diego
thanks..but that was just my typo...
and I am using PHP 4.3, the latest version, I have heard from the forum that HTTP_REFERER might not come out sometimes....
If the user types in the url to the PHP script, then there won't be a HTTP_REFERER. Usually, if the user clicked a link, then there will be a HTTP_REFERER. But the HTTP_REFERER is sent by the browser, so it's up to the browser to send it or not.