![]() |
PHP question
is there a way in a php script to detect if it was called with this url:
http://domain.com/myscript.php#12 or this: http://domain.com/myscript.php some kind of server variable I don't know of? |
nope, those pages are considered one and the same with php.
it could probably be done with a php/javascript combo |
$_SERVER[HTTP_HOST]
|
Is the php script you're talking about running on the same server? Cuz depending on the situation you can use the $_SERVER['REFERER'] or $_SERVER['SCRIPT_FILENAME']. Here's more about the server variables
http://ca3.php.net/reserved.variables |
You could probably use a preg_match to look at the url and see if its being called that way.
Andy |
Code:
if (isset($_SERVER['HTTP_REFERER'])) |
regarding previous post
that code will work only if myscript.php is linking to the php file this code is on. if its not the case then more info needed how is current script beign called by myscript.php |
i tried every server variable, everything in $_SERVER , the #12 is mentioned no where.
referer is not set - it is a bookmark |
Quote:
and as far as i know and tried you can not pass a javascript var to a php var - only the other way around |
Quote:
may need to check your apache logs to see if there were any referer from that particular location, or write your own log |
All times are GMT -7. The time now is 01:49 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123