с этим вроде разобрался...эта ошибка пропала но появилась другая
отправляем смс Познахарев
Phone number format failотправляем смс Шахматов
Phone number format failотправляем смс Стратонов
и т.д.
<?php
function str_to_sec($date){
$t = split("\.",$date);
$sec = mktime(0,0,0,(int)ltrim($t[1],"0"),(int)ltrim($t[0],"0"),$t[2]);
return $sec;
}
$db=mysql_connect("localhost", "root", "parol");
mysql_select_db('lksms', $db);
$tables = array();
$res = mysql_query("show tables");
while ($table = mysql_fetch_array($res)){
if ($table[0]!="auth" && $table[0]!="phone")
$tables[] = $table[0];
}
$clients = array();
foreach($tables as $table){
$res = mysql_query("select * from ".$table);
while($row=mysql_fetch_assoc($res)) $clients[] = $row;
}
foreach($clients as $client){
$can = 0;
if (str_to_sec($client['garant'])>str_to_sec($cur)) $can=1;
else continue;
if ($client['dto']==$odate) $can=1;
if ($can){
$login = 'admin@lk-auto.ru';
$password = 'parol';
$phone = "7".$client['num'];
$from = 'ЛК-Авто';
$msg = urlencode("В ЛК-Авто дополнительная скидка до 70000 руб. в честь 100-летия Chevrolet! Спешите, предложение ограничено");
$dlr = urlencode("http://sms48.ru/send_sms.php?login=$login&to=$phone&from=$from&msg=$msq&check2=$checksumm");
$checksumm = md5($login.md5($password).$phone);
echo "отправляем смс ",$client['clisname'],"<br>";
$res = @file_get_contents("http://sms48.ru/send_sms.php?login=$login&to=$phone&msg=$msg&from=$from&check2=$checksumm&dlr_url=$dlr");
if($res==1){
echo 'Отправлено успешно';
}
else{
echo $res;
}
}
}
?>
есть база lksms в ней таблица phone со всеми номерами