SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2004
    Location
    Norway
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    $_SERVER['REQUEST_URI'] not working

    For some reasons this is not working in my php script, it will just return an empty string. It is used in
    Code:
        function redirect($from=true) {
            if ( $from ) {
                header ( 'Location: '.$this->redirect.'?from='.
                    $_SERVER['REQUEST_URI'] );
            } else {
                header ( 'Location: '.$this->redirect );
            }
            exit();
        }
    I'm using IIS, PHP and MySQL. I remember that so far all $_SERVER[..] is not working at all with my scripts and i have to use absolute location in other cases. Please help. Thanks in advance.

  2. #2
    SitePoint Guru
    Join Date
    Jun 2004
    Location
    Finland
    Posts
    703
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    IIS doesn't support it. Well, it could, but it doesn't. Do this:

    PHP Code:
    $_SERVER["REQUEST_URI"] = $_SERVER["PHP_SELF"] . "?" $_SERVER["QUERY_STRING"]; 


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
  •