Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2003
    Location
    Montreal, Canada
    Posts
    373

    $_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

  2. #2
    Join Date
    Mar 2004
    Posts
    1,301
    you use this:

    if ($_SERVER['HTTP_HOST'] == "www.domain123.com"){
    //
    }
    Last edited by orbitz; 03-23-2004 at 05:25 AM.

  3. #3
    Join Date
    May 2002
    Location
    UK
    Posts
    2,994
    $_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.

  4. #4
    Join Date
    Mar 2004
    Posts
    1,301
    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!

  5. #5
    Join Date
    Mar 2004
    Posts
    1,301
    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?

  6. #6
    Join Date
    Mar 2004
    Posts
    1,301
    nice website Wojtek

  7. #7
    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!

  8. Newsletters

    Subscribe Now & Get The WHT Quick Start Guide!

Related Posts from theWHIR.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •