1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Development $HTTP_REFERRER / URLs with GET variables

Discussion in 'Software' started by Adam, 24 Jan 2003.

  1. Adam

    Adam Minimodder

    Joined:
    26 Jan 2002
    Posts:
    2,638
    Likes Received:
    3
    Can anyone tell me if it's possible to get $HTTP_REFFERER to ignore anything after the ? in a url?

    i.e. /page.php?ID=1 would become /page.php?

    TIA.

    EDIT: Sorted now with
    PHP:
    $from substr($_SERVER['HTTP_REFERER'], 045);
    I should read php.net more often ;).
     
    Last edited: 24 Jan 2003
  2. linear

    linear Minimodder

    Joined:
    5 Oct 2001
    Posts:
    4,393
    Likes Received:
    1
    Yeah you should, but that's probably the wrongest way to do it that I can think of.

    May I suggest parse_url()?
     
  3. Adam

    Adam Minimodder

    Joined:
    26 Jan 2002
    Posts:
    2,638
    Likes Received:
    3
    I also need to learn/remember how to spell referer! Thanks for the tip Linear, I'll stick that in place of my bodged code tomorrow.
     

Share This Page