Pastulio Posted June 16, 2007 Share Posted June 16, 2007 Ok, so I was writing an anti-spam function that looked a little bit like this: // Anti-Spam function function antiSpam ($passedDay, $passedHour, $passedMinutes, $passedSeconds){ $currentHour = date ("H"); $currentMinutes = date ("i"); $currentSeconds = date ("s") $currentTimeSeconds = ($currentHour * 3600) + ($currentMinutes * 60) + $currentSeconds; $passedTimeSeconds = ($passedHour *3600) + ($passedMinuts * 60) + $passedSeconds; $intervalPP = 120; //interval in seconds $totalTime = $currentTimeSeconds - $passedTimeSeconds; if ($totalTime >= $intervalPP){ $_SESSION['antispam'] = "on"; $_SESSION['time_day'] = date ("d") $_SESSION['time_hour'] = date ("H"); $_SESSION['time_minutes'] = date ("i"); $_SESSION['time_seconds'] = date ("s"); return 1; } } And I though... Well what if somebody happens to post at 23:59 (11:59 PM) and again at 00:00 (12 AM). Then the function wouldn't live up to it's cause. Can anybody help me with this because if I do this for another day, the bug will just scoop over to month and year =/. Thanks a lot guys Edit: just saw I didn't even use the $intervalPP variable fixed in the code now Link to comment https://forums.phpfreaks.com/topic/55875-solved-anti-spam-function-help-needed/ Share on other sites More sharing options...
Pastulio Posted June 16, 2007 Author Share Posted June 16, 2007 *bump* Link to comment https://forums.phpfreaks.com/topic/55875-solved-anti-spam-function-help-needed/#findComment-276039 Share on other sites More sharing options...
AndyB Posted June 16, 2007 Share Posted June 16, 2007 http://www.google.ca/search?hl=en&q=php+flood+protection&btnG=Google+Search&meta= flood protection is what you want, not anti-spam. The first few results look promising. Link to comment https://forums.phpfreaks.com/topic/55875-solved-anti-spam-function-help-needed/#findComment-276056 Share on other sites More sharing options...
Pastulio Posted June 16, 2007 Author Share Posted June 16, 2007 Thanks a lot mate . Forgot the name on it so just called it anti-Spam. Since posting a lot of bs on forums is usually called "spamming". sure is a lot to swallow haha, I'll get cracking. Link to comment https://forums.phpfreaks.com/topic/55875-solved-anti-spam-function-help-needed/#findComment-276058 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.