View Single Post
Old 05-12-2008, 05:41 PM   #5 (permalink)
gordon
Junior Member
 
Join Date: 05-07-08
Posts: 4
iTrader: 0 / 0%
Latest Blog:
None

gordon is liked by many
I have added this code to my contact.php file:

Code:
setcookie("contact", "contactform", time()+3600); if ($_POST["contactform"]) ; { echo "<h2>You must wait one hour, before submitting more information via the contact form.</h2>\n"; die (""); }
What I would like to happen is for a cookie to be placed on the visitors computer when they first submit the form(This seems to have been accomplished). I want to do this to prevent the visitor from spamming my inbox.


What I would like to happen now is have the php file display an error message if the cookie already exists on the visitors computer. As it stands now i get the above error message "You must wait one hour, before submitting more information via the contact form". even if the cookie is non existent. So can someone please help me figure this out.

I will also like the cookie to expire after 5 minutes, but i have no idea what the time value needs to be changed to.

Thanks
Gordon
gordon is offline   Reply With Quote