Macemore
Circumcised pineapples
This took me a while to figure out since i'm mentally retarded but here's some features:
1. Gets the requested URL.
2. Gets their IP.
3. Gets user agent.
4. Emails all of that to you.
Make sure to change the $to variable to your email!
(based on m0nsta.'s email form)
Credit to Xenous for showing me how to use custom error pages via .htaccess files
What he gave me:
Credits:
90% ~ Mace (coding most of it)
5% ~ m0nsta. (the entire $message var)
5% ~ Xenous (.htacces file)
1. Gets the requested URL.
2. Gets their IP.
3. Gets user agent.
4. Emails all of that to you.
Make sure to change the $to variable to your email!
(based on m0nsta.'s email form)
PHP:
<html>
<head>
<title>Error</title>
</head>
<body>
<?php
//let's get some info, shall we?
$ip = $_SERVER['REMOTE_ADDR'];
$error = "404 error";
$to = "[email protected]"; //CHANGE THIS TO YOUR EMAIL
$ua = $_SERVER['HTTP_USER_AGENT'];
$subject = "$error";
$url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
$message = '
<html>
<body>
<h1>$error</h1><br />
<br />
<strong>IP:</strong> ' . $ip . ' <br />
<strong>Browser agent:</strong> ' . $ua . ' <br />
<strong>Error:</strong> ' . $error . ' <br />
<strong>Requested URL:</strong> ' . $url . ' <br />
</body>
</html>
';
$headers = 'MIME-Version: 1.0' . "\r\n"; //make sure that HTML is enabled!
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
?>
<?php
//sending that email
mail( $to, $subject, $message, $headers );
?>
<!- Show them the error also! -->
<br />
<h1><?php echo $error; ?> </h1>
<br />
<br />
<p1>Looks like the file or folder you were looking for was not found!<br />
For security reasons we've logged your IP (<?php echo $ip; ?>) was logged. </p1><br />
Info:<br />
<strong>IP:</strong> <?php echo $ip; ?><br />
<strong>Browser agent:</strong><?php echo $ua; ?><br />
<strong>Error:</strong><?php echo $error; ?><br />
<strong>Requested URL:</strong><?php echo $url; ?><br />
<br />
<p1> E-Mail the webmaster here: <?php echo $to ?>
</body>
</html>
What he gave me:
Code:
<Files .htaccess>
order allow,deny
deny from all
</Files>
ErrorDocument 404 /404.php
90% ~ Mace (coding most of it)
5% ~ m0nsta. (the entire $message var)
5% ~ Xenous (.htacces file)