SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    Setting up a connection... mgyth's Avatar
    Join Date
    Nov 2004
    Location
    Mosjøen - Norway
    Posts
    255
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    $http_referer ??

    I want to redirect the browser to the page it came from.
    I tried using $HTTP_REFERER, but it's empty on the script page.
    I tried giving a variable the value of the current url, and passing it off in the url like this:
    PHP Code:
    $url $REQUEST_URI
    and it works fine, the variable is given to the script using the url, but then my header won't use it.
    this is my header code:
    PHP Code:
    $url $_REQUEST['url'];
    header ("Location: http://www.forsikrings-listen.no $url"); 
    I also tried:
    PHP Code:
    $url $_REQUEST['url'];
    header ("Location: http://www.forsikrings-listen.no" $url); 
    and so on.
    Anyone got any thips on what I'm doing wrong here?
    All help appreciated.
    www.gwd.no Webdesign.

  2. #2

    Join Date
    Oct 2003
    Location
    €uroLand
    Posts
    1,340
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Something like this?
    PHP Code:
    header('Location: '.$_SERVER['HTTP_REFERER']); 

  3. #3
    Setting up a connection... mgyth's Avatar
    Join Date
    Nov 2004
    Location
    Mosjøen - Norway
    Posts
    255
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That didn't work. is there a way to check if the http_referer function is disabeled?
    www.gwd.no Webdesign.

  4. #4
    SitePoint Evangelist djdykes's Avatar
    Join Date
    Feb 2005
    Location
    Chester, Cheshire
    Posts
    565
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    isn't it a global? check if register globals is turned off in the php.ini file... if it is try again with it turned on...


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
  •