SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Oct 2006
    Posts
    132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    A few things I just learned about phpinfo()

    I was unaware that the environment variable shown in my phpinfo() was dynamic! In an attmept to redirect users back to the page they came from after login, I follwed directions and used the getenv("HTTP_REFERER") to get the page they had come from. It worked perfectly except that when I directly accessed the login from my browser address bar.

    Being a bit confused, I went directly to a script to display phpinfo() and couldn't find the referer variable anywhere. Then it came to me, I had not come from another "page" via a link to get to where I was so the variable was not ever set. so no need to display it in phpinfo().

    I kind of pays to play around a bit and see what happens!

    l

  2. #2
    SitePoint Wizard silver trophy
    Join Date
    Mar 2006
    Posts
    6,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the referer variable is a user supplied variable.

    browsers often will not send this variable. user can configure thier browser to never send it.

    users can send you any value they want, including values that arent even a url at all.

    treat it like you would treat a $_GET variable.

  3. #3
    SitePoint Zealot
    Join Date
    Oct 2006
    Posts
    132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I didn't know that either! Thanks clamcrusher!

    Al


Bookmarks

Posting Permissions

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