I'm working with a project to send SMS with Huawei E153 dongle with PHP.But my code is not working with this modem.(It's working with my Samsung mobile phone).To order to solve this problem I need to check respond from modem.Please help.Here is my code.
<?php
$filename ="COM20";
date_default_timezone_set('Asia/Colombo');
$date = date('Y/m/d H:i:s');
$message="This is a test message 2 .$date.";
$numbers = array("+941234567");
if (!$handle = fopen($filename, 'r+'))
{
echo "The device isn't detected";
exit;
}
else
{
foreach ($numbers as $value) {
if (fwrite($handle,"AT+CMGF=1\n\r"))
sleep(5);
{
fwrite($handle, "AT+CMGS=\"$value\"\n\r");
sleep(5);
fwrite($handle,"$message".chr(26)."\n\r");
sleep(7);
echo "sent to $value <br>";
}
}
fclose($handle);
echo "Port Closed";
}
?>