By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,956 Members | 1,683 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,956 IT Pros & Developers. It's quick & easy.

Problem with REQUEST_URI

P: n/a
I hope I'm not doing something really stupid .... but I can't get this
to work properly.

I'm using $_SERVER['REQUEST_URI'] to get the name of the *referring*
page for use in a custom 404 page.

All works hunky-dory (with an .htaccess script and so on) ... but the
value always seems to return the *current* page (ie. the actual error
page that the user lands on) - not the "from" (referring) page.

OK ... so I tried a simple page with a regular URL link to another
page. The value of $_SERVER['REQUEST_URI'] on that 2nd page was also
the name of that 2nd page - yet $_SERVER['HTTP_REFERER'] gives the
required value.

What am I missing (apart from brain cells!)?

Is there a way of determining the referring page on non-Apache
servers?

Adam.
Jun 15 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
See your phpinfo() result ...

Look at the PHP Variables..you'll find like :
_SERVER["HTTP_ACCEPT"]
_SERVER["HTTP_REFERER"]
and other variables. Check your refering variables for your server.

--
http://blog.deshot.com
http://www.padbuilder.com

Adam wrote:
I hope I'm not doing something really stupid .... but I can't get this
to work properly.

I'm using $_SERVER['REQUEST_URI'] to get the name of the *referring*
page for use in a custom 404 page.

All works hunky-dory (with an .htaccess script and so on) ... but the
value always seems to return the *current* page (ie. the actual error
page that the user lands on) - not the "from" (referring) page.

OK ... so I tried a simple page with a regular URL link to another
page. The value of $_SERVER['REQUEST_URI'] on that 2nd page was also
the name of that 2nd page - yet $_SERVER['HTTP_REFERER'] gives the
required value.

What am I missing (apart from brain cells!)?

Is there a way of determining the referring page on non-Apache
servers?

Adam.


Jun 15 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.