PDA

View Full Version : What's the php code for if voted cant vote again for 1hour?



iSwifter
27-03-2015, 08:43 PM
I have this vote dj script but it doesnt warn them when trying to vote again before 1 hour is over here is how its formatted.


// Is this a valid link?
if ( ! isset($ccount_database[$id]) )
{
die('Link with this ID not found');
}

// Increse count by 1
$ccount_database[$id]['C']++;

// Is this a unique click or not?
if ( ! isset($_COOKIE['ccount_unique_'.$id]) )
{
$ccount_database[$id]['U']++;
}

// Update the database file
rewind($fp);
fwrite($fp, "<?php die();//" . serialize($ccount_database));
}
else
{
// Lock not successful. Better to ignore than to damage the log file
die('Error locking file, please try again later.');
}

// Release file lock and close file handle
flock($fp, LOCK_UN);
fclose($fp);

Want to hide these adverts? Register an account for free!