Click to See Complete Forum and Search --> : Error pages


clairec666
05-20-2004, 05:14 AM
I'm using abyss web server (http://www.aprelium.com/abyssws/) and it allows me to edit my error pages for when a user has tried to access a page which can't be found. At the moment, I just have a plain HTML page which redirects my user back to the home page.

Is there a method, using PHP, of retrieving the URL of the page my user was trying to find? Eg, I want my page to show something like this: "www.mypage.com/page1.html is unavailable. Please go back to the homepage and try again." But how to I retrieve this URL?

Thanks

Conor
05-20-2004, 05:49 AM
$_SERVER['HTTP_REFERER] although it can be faked.

clairec666
05-20-2004, 05:50 AM
Thanks very much :D It doesn't matter whether it can be faked or not.

clairec666
05-21-2004, 07:05 AM
This isn't working for me. :confused: When I'm redirected to http://localhost/error/error.html (my custom error page) I use <?php print $_SERVER['HTTP_REFERER'] but it just prints http://loaclhost/error, not the page I was originally trying to get to.

Conor
05-21-2004, 02:30 PM
It works for me.......