View Single Post
Old 05-17-2011, 07:59 PM  
mkx
Confirmed User
 
Industry Role:
Join Date: Nov 2003
Location: Toronto
Posts: 4,001
tested it using a 3 email per hour limit and it didnt seem to end. maybe i need a proper if statement? either that or interval 1 hour isn't recognized. here is the piece of the script:


//anti abuse - makes sure no more than 250 emails are sent out in one hour

mysql_query("INSERT INTO antiabuse (emailsent)
VALUES ('1')");




$result = mysql_query('select count(*) from antiabuse where `time` > curtime() - interval 1 hour');
$row = mysql_fetch_row($result);
$count = $row[0];

if ($count > 3) {
die('Sorry, please wait and try again in a few minutes.');
}



//then if it doesn't end from the anti abuse script, the send email script starts below
$to = "$xemail";
mkx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote