runnerjp Posted November 14, 2008 Share Posted November 14, 2008 for some reason my if statement does not work <?php $lastpost = $userinfo['last_post']; echo $lastpost ; if ( $lastpost <= 30 ) {echo 'dont flood';} else { echo 'your not flooding';}?> it always echos your not flooding even if its been 5 seconds or 10 minutes.. echo $lastpost came out with 1226663481 so its grabing the time but i dont understand why its not echoing dont flood :S Link to comment https://forums.phpfreaks.com/topic/132690-solved-stoping-forum-flooding/ Share on other sites More sharing options...
DarkerAngel Posted November 14, 2008 Share Posted November 14, 2008 <?php $lastpost = $userinfo['last_post']; echo $lastpost ; if ( ( time() - $lastpost ) <= 30 ) {echo 'dont flood';} else { echo 'your not flooding';} ?> [untested] Link to comment https://forums.phpfreaks.com/topic/132690-solved-stoping-forum-flooding/#findComment-690069 Share on other sites More sharing options...
runnerjp Posted November 14, 2008 Author Share Posted November 14, 2008 oh boy thats why... i need to compare it to time... lol thanks DA Link to comment https://forums.phpfreaks.com/topic/132690-solved-stoping-forum-flooding/#findComment-690071 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.