Results 1 to 3 of 3

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

  1. #1
    Join Date
    Mar 2008

    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
    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.)
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

  3. #3
    Join Date
    Sep 2012
    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