SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    Always learning viveknarula's Avatar
    Join Date
    Mar 2006
    Location
    INDIA
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question $_SERVER['HTTP_REFERER'] problem

    Hi,

    I am having problem with $_SERVER['HTTP_REFERER'] i put this in my PHP coding however it is giving me the error in IE6.0 however in Firefox it is working perfectly. I see with print_r($_SERVER) in FF it is showing HTTP_REFERER in the array however is NOT showing in the IE6.0.

    It seems that it is browser specific. Is there any alternative to $_SERVER['HTTP_REFERER'] which works in All the browsers or in anyway i can make $_SERVER['HTTP_REFERER'] work in all the browsers.


    Thanks !!

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,868
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    PHP runs on the server - which browser is being used makes no difference to the code working or not.

    Where the browser can make a difference regarding the HTTP_REFERER value is that it can be disabled in the browser so that it doesn't get sent.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    Always learning viveknarula's Avatar
    Join Date
    Mar 2006
    Location
    INDIA
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    PHP runs on the server - which browser is being used makes no difference to the code working or not.

    Where the browser can make a difference regarding the HTTP_REFERER value is that it can be disabled in the browser so that it doesn't get sent.
    Thanks felgall, can you please let me know most of time whether this is enabled or disabled in the browsers ?

  4. #4
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's usually enabled by default, although different browsers have different scenarios of when they won't send it even when enabled.

    What specifically do you think you need this for? Be detailed and we can provide a solution.

  5. #5
    Always learning viveknarula's Avatar
    Join Date
    Mar 2006
    Location
    INDIA
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by crmalibu View Post
    It's usually enabled by default, although different browsers have different scenarios of when they won't send it even when enabled.

    What specifically do you think you need this for? Be detailed and we can provide a solution.
    Well, i would like to see from where the user is coming to my website. What i am doing is, i am sending an link such as <a href="#" onclick="myfuntion()">MY TEXT</a> When a user clicks on this link that javascript function will redirect that user to my webpage. I would like to know from which page the user is coming from ?

    I hope i make myself clear.

    Thanks !!

  6. #6
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,868
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    It is entirely up to your individual visitors whether they turn on the privacy setting in their browser that removes the value from that field (or use the tools in their browser to change the value to whatever they decide it should be).

    If you want to know which other page on your site they were on then you can pass that yourself in the querystring on the end of the link and read it from there.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  7. #7
    Always learning viveknarula's Avatar
    Join Date
    Mar 2006
    Location
    INDIA
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question

    Quote Originally Posted by felgall View Post
    It is entirely up to your individual visitors whether they turn on the privacy setting in their browser that removes the value from that field (or use the tools in their browser to change the value to whatever they decide it should be).
    OKay.
    Quote Originally Posted by felgall View Post
    If you want to know which other page on your site they were on then you can pass that yourself in the querystring on the end of the link and read it from there.
    I can't pass anything in that function. Actually that link will be at some other website. Something like Widgets.

    Thanks !!


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
  •