www.webdeveloper.com
Results 1 to 3 of 3

Thread: $_SERVER['REQUEST_URI'] Gives completely wrong url

  1. #1
    Join Date
    Mar 2008
    Posts
    70

    Question $_SERVER['REQUEST_URI'] Gives completely wrong url

    Hi when I display a page with a broken photo, the $_SERVER['REQUEST_URI'] becomes that photo url for some reason.

    So if I'm on mysite.com/article.html

    function page_echo($html)
    {

    //somewhere in $html is <img src='mysite.com/photothatdoesntexist.jpg' />

    echo $html

    //This is the only place that I ever call REQUEST_URI or ever set last_url.
    $_SESSION['last_url'] = $_SERVER['REQUEST_URI'];
    }


    And somehow on the next pageload $_SESSION['last_url'] becomes "/photothatdoesntexist.jpg" instead of "/article.html"

    Anyone know how that is possible?

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    18,926
    Sounds like a flaky web server issue, though I may be missing some important detail. Is this by any chance some sort of AJAX implementation, or just a straight-ahead PHP page being called directly by the browser? (I'm not sure why that would matter, mind you.)
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Sep 2012
    Posts
    1
    I've got a site with the same issue.

    Did you ever find out what the deal was?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles