Posted: Mon Oct 13, 2008 3:48 pm Post subject: [PHP] .htaccess and $_SERVER[PHP_SELF]
Well, I'm trying to make a page not found page which will say "The page /blahblah could not be found" when they stumble upon a 404. I tried to do that by:
/.htaccess:
Code:
ErrorDocument 404 /404.php
/404.php:
Code:
<title>Page Not Found</title>
<?php
echo "The page " .$_SERVER[PHP_SELF]. " was not found.<br><br>Go to the <a href=/index.php>index</a>.";
?>
And it shows in my browser:
Quote:
The page /404.php was not found.
Go to the index.
Is there a way to get the current page and not the current file its reading? Thanks. _________________
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum