|
Posted by ZeldorBlat on 12/06/05 02:00
First of all, don't count on the HTTP_REFERER (sic) variable to be
accurate. It's up to the browser to set it, so it can always be
incorrect or not there.
Having said that, what you want is strpos():
<http://www.php.net/strpos>
Better yet, try his cousing stripos() for a case insensitive match. So
something like this:
if(stripos($_SERVER['HTTP_REFERER'], 'cominghost.com') !== false) {
//Special code goes here
}
else {
//Normal code goes here
}
Of course this isn't totally correct because
http://www.foo.com/bar/cominghost.html would be accepted. If it's
really that important, you can use a regular expression instead.
Navigation:
[Reply to this message]
|