Results 1 to 7 of 7
Thread: $_server['http_referer']
-
03-23-2004, 03:23 AM #1Aspiring Evangelist
- Join Date
- Sep 2003
- Location
- Montreal, Canada
- Posts
- 374
$_server['http_referer']
How can I make a certain part of text hidden if someone came from a specific domain?
$_SERVER['HTTP_REFERER'] would only be good to tell if user came from a specific page, what about server-wide?
Ex: all people who came from any page from domain123.com don't see the latest news.
Thanks
-
03-23-2004, 05:22 AM #2Web Hosting Master
- Join Date
- Mar 2004
- Posts
- 1,303
you use this:
if ($_SERVER['HTTP_HOST'] == "www.domain123.com"){
//
}Last edited by orbitz; 03-23-2004 at 05:25 AM.
-
03-23-2004, 05:51 AM #3Web Hosting Master
- Join Date
- May 2002
- Location
- UK
- Posts
- 2,997
$_SERVER['HTTP_HOST'] is the current server not a referring domain.
You can use HTTP_REFERER but unfortunately it is very easily bypassed, and in fact most personal firewalls disable this information automatically.
-
03-23-2004, 06:11 AM #4Web Hosting Master
- Join Date
- Mar 2004
- Posts
- 1,303
yeah, sorry, I had already gone to sleep and realized that it was for the current host, I had to get back here but it is too late to edit my post ...bed time again!
-
03-23-2004, 06:14 AM #5Web Hosting Master
- Join Date
- Mar 2004
- Posts
- 1,303
Originally posted by Rich2k
$_SERVER['HTTP_HOST'] is the current server not a referring domain.
You can use HTTP_REFERER but unfortunately it is very easily bypassed, and in fact most personal firewalls disable this information automatically.
ohh, so if I happen to use HTTP_REFERER and users block this info, my script won't work? what if the HTTP_REFERER comes within my domain?
-
03-23-2004, 06:18 AM #6Web Hosting Master
- Join Date
- Mar 2004
- Posts
- 1,303
nice website Wojtek
-
03-23-2004, 05:16 PM #7Web Hosting Master
- Join Date
- Jan 2003
- Posts
- 1,715
That's the problem with any client-supplied data -- you can't depend on it and you should treat anything they provide like a live grenade.
So you can use HTTP_REFERER, but make provisions so your site still works if it's invalid or not provided.Game Servers are the next hot market!
Slim margins, heavy support, fickle customers, and moronic suppliers!
Start your own today!