August 29th, 2003, 03:21 AM
Send Mail w/PHP with time limit
i'm trying to do a form thing were people can send mail to me by filling out a forum. I also dont want people to spam me, so i want to make sure a visitor can only send mail to me every hour. How would i go about doing this? I have the following PHP coding so far..
I just dont know how to do the ip time limit thing, can someone help?
if (isset($_POST['name']) && isset($_POST['email']))
$headers = "From: $email\n";
$message="Name: $name\n\nEmail: $email\n\nCaption: $caption";
if (!$name || !$email || !$caption)
echo 'You have left some areas blank. Please fill out the form completely';
echo "Name: $name
Thank you, $name, for your comment. ";
echo "There was a problem sending the mail. Please contact The Webmaster if this problem persists.";
echo "To submit a Caption, please look under \"Create a Caption\" under the navigaiton";
August 29th, 2003, 04:16 PM
I'm not a expert in PHP but the only way I see is whenever someone send you a e-mail, the php script store the time in a txt/dat file or sql database. When the user return, you just do a quick check if your timer is done..
August 29th, 2003, 06:57 PM
yeah, that's what i was thinking, but i dont know how to do the timestamp thing as well as check it against the i.p. in the text file