Page 1 of 1

Getting Requested URL In 404 error page

Posted: Sun Oct 17, 2010 5:06 am
by dentrite
How can i get user requested url in a page 404.php which has been set as 404 error document by my host. if a page doesnt exits 404 opens up. i want to know what url was typed by the user. thanks in advance

Re: Getting Requested URL In 404 error page

Posted: Sun Oct 17, 2010 5:12 am
by requinix
Take a look at $_SERVER. I bet you there's something useful in there.

Spoiler: I only bet when I know I'll win.

Re: Getting Requested URL In 404 error page

Posted: Sun Oct 17, 2010 7:34 am
by dentrite
I couldn't understand it.... please give full solution

Re: Getting Requested URL In 404 error page

Posted: Sun Oct 17, 2010 7:39 am
by requinix
dentrite wrote:I couldn't understand it.... please give full solution
No.

Code: Select all

print_r($_SERVER);