The htaccess option would not really be a great solution for me given we
have many diferent htacces files do lots of different things.

But I did try it just in case it lead me to some answers. I created a new
directory placed a .htaccess file in there with the correct stuff directing
404's to a test error page. The test error page has your exact code except I
dont mail I just displayed and it all worked, BUT the $URL variable as per
you last email just contains the URL of the error document.

I'm thinking maybe some settings in my php.ini file need to be different.
I'm looking into that now.

Paul


"David Robley" <[EMAIL PROTECTED]> wrote in message
01031612205409.01881@www">news:01031612205409.01881@www...
> On Fri, 16 Mar 2001 12:13, Paul R. Jackson wrote:
> > >>Check out REQUEST_URI - from that you can build a full URL if you
> > >> need it.
> >
> > The REQUEST_URI only has the URI of the error page itself (in my case
> > /error/404.html) I want the URI of the page that wasn't found.
> >
> > A php info doesnt show the URI anywhere.
> >
> > Thanks for the speedy response
> >
> > Paul
>
> Try moving the errordocument 404 /error/404.html from your httpd.conf
> into .htaccess files.
>
> Here's what I use and it mails me an error message as well!
>
> <?php
>
> $admin_email = "[EMAIL PROTECTED]";
> $from = "From: [EMAIL PROTECTED]";
> $website_url = $SERVER_NAME;
> $subject = "404 Error at $REQUEST_URI";
> $URL = "http://" . getenv("HTTP_HOST");
> $URL .= ereg_replace( "[^!#-9:;=?-Z_a-z~]", "",
> substr(getenv("REQUEST_URI"), 0, 200) );
>
> $body = "WEBSITE--\n$website_url\n
> BAD LINK--\n$URL\n\n
> PAGE WITH BAD LINK--\n$HTTP_REFERER\n
> TYPE--\n404 File Not Found\n\n
> WHO WAS ACCESSING--\n$REMOTE_ADDR: $REMOTE_HOST\n
> USER AGENT\n$HTTP_USER_AGENT";
>
> mail($admin_email,$subject,$body,$from);
> ?>
>
> <title>Centre for Injury Studies - File Not Found</title>
> </head>
> <table border="0" cellspacing="0" cellpadding="10" align="center"
> BGCOLOR="#70DBDB">
> <tr><td>
> <!-- <h1 align="center">File Not Found </h1> -->
> <P ALIGN="CENTER"><IMG SRC="/images/404.gif" WIDTH=321 HEIGHT=120></P>
> <p>The requested URL <?php print($URL) ?> was not found on this
> server.</p>
> <ul>
> <li>If you followed this link form another page on our site, it is
> possible
> that it is inaccurate or outdated. This error has been logged, and we
> will look into it right away. </li>
> <li>If you entered the requested URL by hand, check and make sure you
> entered it correctly. Remember, URL's are case-sensitive. Index.html
> is not equal to index.html.</li>
> <li>If you followed a link from another web site, try contacting that
> site's webmaster and inform them that their link may be broken.</li>
> <LI>As a result of the upgrade of our web site, some URLs have been
> changed. Try
> using the Quick Search option above or our <A
> HREF="/search/search.php">Search Page</A>
> to locate the document you are seeking.</LI>
> <?php
> if(strpos($URL, '3icipc')) {
>   echo '<LI STYLE="COLOR:red">';
>   }
> else {
>   echo '<LI>';
> }
> ?>
> Program and proceedings of the 3rd International Conference on Injury
> Control and
> Prevention (3ICICP) are no longer available here.</LI>
> </ul>
> <h3 align="center"><a href="<?php echo $HTTP_SERVER?>">Back to our main
> page.</a></h3>
> </TD></tr>
> </table>
>
> </html>
>
>
> --
> David Robley                        | WEBMASTER & Mail List Admin
> RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
> AusEinet                            | http://auseinet.flinders.edu.au/
>             Flinders University, ADELAIDE, SOUTH AUSTRALIA
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to