|
-
August 29th, 2003, 03:21 AM
#1
Banned
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..
PHP Code:
<?php
if (isset($_POST['name']) && isset($_POST['email']))
{
$name=$_POST['name'];
$email=$_POST['email'];
$caption=$_POST['caption'];
str_replace('\"','"',str_replace("'","'",$name));
str_replace('\"','"',str_replace("'","'",$caption));
$to="[email protected]";
$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';
}
if(mail($to,"Caption",$message,"$headers"))
{
echo "Name: $name Email: $email Caption: $captionz
Thank you, $name, for your comment. ";
}
else
{
echo "There was a problem sending the mail. Please contact The Webmaster if this problem persists.";
}
}
else
{
echo "To submit a Caption, please look under \"Create a Caption\" under the navigaiton";
}
?>
I just dont know how to do the ip time limit thing, can someone help?
-
August 29th, 2003, 04:16 PM
#2
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
#3
Banned
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|