/    Sign up×
Community /Pin to ProfileBookmark

$_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?

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@NogDogAug 09.2010 — 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.)
Copy linkTweet thisAlerts:
@adam3000Sep 11.2012 — I've got a site with the same issue.

Did you ever find out what the deal was?
×

Success!

Help @curtay spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.8,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...