Getting Requested URL In 404 error page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dentrite
Forum Newbie
Posts: 16
Joined: Thu Jun 17, 2010 7:10 am

Getting Requested URL In 404 error page

Post 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
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Getting Requested URL In 404 error page

Post 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.
dentrite
Forum Newbie
Posts: 16
Joined: Thu Jun 17, 2010 7:10 am

Re: Getting Requested URL In 404 error page

Post by dentrite »

I couldn't understand it.... please give full solution
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Getting Requested URL In 404 error page

Post by requinix »

dentrite wrote:I couldn't understand it.... please give full solution
No.

Code: Select all

print_r($_SERVER);
Post Reply