I using nowsms gateway to send sms to myself, What I want is my php coding must set the crontab with every minute will refresh my page, so once the cronjob running, it will auto send sms to me, so every minute also I will get one sms, but how to I just send once for my phone with the cronjob always running each of the minute?
how to check today my number already send out once, so next minute no need send another same sms to me, just wait until next day only get another sms.
here is my send sms coding,
SendSMS("192.168.1.31", 8800, "test", "test", 60163855853, $finalresult);
function SendSMS ($host, $port, $username, $password, $phoneNoRecip, $msgText) {
$fp = fsockopen($host, $port, $errno, $errstr);
if (!$fp) {
echo "errno: $errno \n";
echo "errstr: $errstr\n";
return $result;
}
fwrite($fp, "GET /?Phone=" . rawurlencode($phoneNoRecip) . "&Text=" .rawurlencode($msgText) . " HTTP/1.0\n");
if ($username != "") {
$auth = $username . ":" . $password;
$auth = base64_encode($auth);
fwrite($fp, "Authorization: Basic " . $auth . "\n");
}
fwrite($fp, "\n");
$res = "";
while(!feof($fp)) {
$res .= fread($fp,1);
}
fclose($fp);
return $res;
}