Jump to content

need help


kev wood

Recommended Posts

the part of the code that you have changed needs to remain the same as i think that section is working all i need to know is how to make it evaluate if a minute has passed at the minute all the code when it is together looks like this

 

$query = "SELECT sent_messages FROM email_count"or die(mysql_error());
$results = mysql_query($query);
$arr = mysql_fetch_array($results);
$sent_mail = $arr[0];

$query = "SELECT last_sent FROM time"or die(mysql_error());
$results = mysql_query($query);
$arr = mysql_fetch_array($results);
$sent = $arr[0];

$time_diff = time() - $sent;

$time_diff = intval($time_diff / 60);

if($sent_mail < 30) {

// the page i want the user to go to if the count is less than 200 and specified time has passed

}elseif ($time_dif >= 1400) // this is the line of code i want to change to a minute.  it evaluates if 24 hours has passed with this number
{

mysql_query("Truncate table time");
mysql_query("Truncate table email_count");
echo '<META HTTP-EQUIV="Refresh" Content="0; URL=maillists.php">'; //redierct user when they can't send any more emails.
}
else{
echo '<META HTTP-EQUIV="Refresh" Content="0; URL=limit.php">'; //redierct user when they can't send any more emails.
}

 

the code works if the count is less than 200 it sends the user to the page i want and if it over it sends them to the page i want.  i now need to test the code so i can see if works if the time stated has passed.  but i cannot get this to work as of yet

Link to comment
https://forums.phpfreaks.com/topic/108689-need-help/#findComment-557387
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.