This is the error i get form my error_log on my server online
PHP Warning: implode() [<a href='function.implode'>function.implode</a>]: Invalid arguments passed in /home1/zxx/public_html/admin/userindex/sms/sms.php on line 127
i looked in all of the code but can't find why that error.
Here is the code, it's an sms app writing in php.
<?php
$smsghurl="http://api.smsgh.com/v2/messages/send";
$smsghuname="xxx";
$smsghpass="xxx";
$shortcode="xxx";
//select total number of subscribers
$query1 = "SELECT count(phone) FROM contacts";
$fones = mysql_query($query1);
$num = mysql_result($fones,0,0);
//select every thing from diction
$query = "SELECT * FROM diction WHERE status='unsent' LIMIT 1";
$sql = mysql_query($query);
$total = mysql_num_rows($sql);
$result = mysql_fetch_array($sql);
$val = $result['id'];
$msg = $result['msg'];
$pos = 1;
while($num !=0)
{
$squery = "SELECT * FROM contacts WHERE id=$pos";
$sall = mysql_query($squery);
$stotal = mysql_num_rows($sall);
$sresult = mysql_fetch_array($sall);
$phone_no = $sresult['phone'];
$smsg = str_replace("+","00",$phone_no);
$pos++;
$num--;
$txt=urlencode($msg);
$send= "http://api.smsgh.com/v2/messages/send?username=xxx&password=xxx&from=xxx&to=$phone_no&text=$txt&id=client1";
$final=implode("",file($send));
}
//set sent info as unsent
$query2 = "UPDATE diction SET status ='sent' WHERE id='$val'";
$result2 = mysql_query($query2) or die ("Error! No information available".mysql_error());
// Get details form user
$sendfrm =strtolower($_REQUEST['text']);
$phone_no =$_REQUEST['to'];
$shortcode =$_REQUEST['from'];
$when =$_REQUEST['date'];
if($sendfrm == 'med')
{
$sql = "INSERT INTO contacts(phone, status, register) VALUES ('$phone_no','unsent', '$when')";
mysql_query($sql) or die(mysql_error);
$submgs = "Thank you for subscribing to xxx,to unsubscribe txt hstop to xxx";
$txt=urlencode($submgs);
$send= "http://api.smsgh.com/v2/messages/send?username=xxx&password=xxx&from=xxx&to=$phone_no&text=$txt&id=client1";
$final=implode("",file($send));
}
if($sendfrm == 'hstop')
{
$query = "UPDATE contacts SET status ='stop' WHERE phone=$phone_no";
$result2 = mysql_query($query) or die ("Unsubcription failed".mysql_error());
$unsub= "Thank you for your time with xxx,to subscribe at any time txt xxx to xxx";
$txt=urlencode($unsub);
$send= "http://api.smsgh.com/v2/messages/send?username=xxx&password=xxx&from=xxx&to=$phone_no&text=$txt&id=client1";
$final=implode("",file($send));
}
?>