Forum Moderators: coopster
This page will NOT have incoming links, so it won't be having much traffic, which I know could get ugly!
Anyone know of an existing script for this? Or can point me to how to build one?
Thanks!
<?php
$mail_path = "/usr/sbin/sendmail -i -t";
$mail_to = "your@email.com";
$mail_subject = "Fell in trap";
ini_set("sendmail_from", $mail_from);
ini_set("sendmail_path", $mail_path);if(mail($mail_to,$mail_subject, "IP: ".$_SERVER["REMOTE_ADDR"]."\nUA: ".$_SERVER["HTTP_USER_AGENT"], "From: $_POST[email]\r\n". "Reply-To: $_POST[email]\r\n"))
{
echo "haha, got ya!";
}
exit;
?>
Just make this your trap page and the job is done.
I have it set with an identifier on the end of the url, so when someone falls in, it says www.mysite.com/certainpage.htm?=1
The 1 identifies which thief...er...user, it is...Any way to add that info to the email?
Either way, you're the best, thanks!
Neo's weblog trap Version 2.0:
<?php
$who = $HTTP_GET_VARS["who"];
$mail_path = "/usr/sbin/sendmail -i -t";
$mail_to = "your@email.com";
$mail_subject = "Fell in trap";
ini_set("sendmail_from", $mail_from);
ini_set("sendmail_path", $mail_path);if(mail($mail_to,$mail_subject, "IP: ".$_SERVER["REMOTE_ADDR"]."\nUA: ".$_SERVER["HTTP_USER_AGENT"] . "\nWho:" . $who, "From: $_POST[email]\r\n". "Reply-To: $_POST[email]\r\n"))
{
echo "haha, got ya!";
}
exit;
?>
Url is then www.mysite.com/certainpage.htm?who=1
You can change the name of the parameter who to whatever you like.
>Either way, you're the best
Never. But would you please tell this my woman, my mother and my brother pleeeeease. :)
>Okay, one last question
No problem at all with further questions but gimme a break for a bath. :)
In addition to an email alert there is another fun little service called Instant Gratification that send an instant message to you over AIM telling you when someone accesses a webpage.
unpossible.com/blogtraffic.html will fix you up :). Its very easy to setup as they've got an HTML code snippet generator that you use to build a snippet that you just cut and paste into your webpage to activate the service.
Its very advanced too as you can even have users cookify themselves so that you can identify the user by email address and name and not just ip address. But it should show you the entire URL including the query as well.
[edited by: jatar_k at 8:57 pm (utc) on Nov. 20, 2003]
[edit reason] delinked [/edit]