Jump to content

Can anyone correct this?


GetReady

Recommended Posts

The following wont work once added to my current codebase any ideas as to why? Thanks.

}
   
   if ($time=$conf["hours_to_block_same_user_attacking"]*60*60;
	$IP=isIPNewerThen($ip,$time);
	if ($IP){
		//print_r($IP);
		//$IP=getIP($ipID);
		$time=time()-$IP->time;
		//alert($time);
		$time=$conf["hours_to_block_same_user_attacking"]*60*60-$time;
		//alert($time);

		$t=$time/(60*60);
		$tF=floor($t);
		$timeA['tm_hour']=$tF;
		$time=$time-$tF*60*60;

		$t=$time/(60);
		$tF=floor($t);
		$timeA['tm_min']=$tF;

		$time=$time-$tF*60;
		$timeA['tm_sec']=$time;
//			$t=($time-$timeA['tm_sec'])


	?>You may only steal from an individual once per 6 hours.<br> You will need to wait 
<?=$timeA['tm_hour']?> hours, <?=$timeA['tm_min']?> minutes and <?=$timeA['tm_sec']?> seconds before attacking again  
	<?
	}
	else{

Link to comment
https://forums.phpfreaks.com/topic/208750-can-anyone-correct-this/
Share on other sites

      if ($time=$conf["hours_to_block_same_user_attacking"]*60*60;

 

you don't close the bracket, and you shouldn't have a colon ending the if argument.

i.e.

      if ($time=$conf["hours_to_block_same_user_attacking"]*60*60)
{
//code to execute if true
}

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.