[Help] IP Logging
Posted 08 April 2006 - 05:13 AM
I'm trying to take a contact form I made using php and make it so that it will only allow a visitor the ability to fill out the form and send it once every 15 minutes. How can implement this using php?
Posted 08 April 2006 - 09:35 AM
<input type="hidden" name="IPADDY" id="IPADDY" value="<?php echo $_SERVER['REMOTE_ADDR']; ?>">
now on submission of the form have a table to log ipaddy and the time...
$query = mysql_query("INSERT INTO `iplog` (`ipaddy`,`time`) VALUES ('" . $_POST['IPADDY'] . "', '" . mktime() . "');
before you add that line query the table for that ipaddress and se if the corresponding time is > (mktime() - (60 * 15)) if it is they tried less than 15 mins ago so display a message telling thme so. If not process the formand add that info to your log table.
Posted 14 April 2006 - 01:10 AM
I can't stop you from doing something silly, but at least I can help you do it right.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users