Hi
I have a logical problem , I have to send an sms to registered user for every 30 mins if the connection is offline. my question here is, it will automatically excute the program for every 2 mins.. if the connection is offline then it will send an sms first time then after it will check the time 30 mins, after that for every 30 mins it will send an sms again. can any one change my code to satisfy these conditions
please check my code
if ( $plant['modbus_error']==11
&& $plant['extra']['check']==
"on" )
{
$count=0;
$message="Connection Alerts: ";
$message.=$plant['descript
ion'];
$message.="@";
$message.=time();
$message.="@";
$message.="Logger is offline";
if($count<1)
{
$time_limit=$plant['extra'
]['time_li
mit'];
$time_limit=$time_limit*60
;
$time_calc=time()+$time_li
mit;
}
echo $time_calc;
if($time_calc<time() || $count==0)
{
for ($i=0; $i<count($plant['extra']['
contact'][
'sms']);$i
++)
{
$error_co= techstudio_sms_send ( $plant['extra']['contact']
['sms'][$i
], $message );
}
}
}