0
Here'is Kannel的一個服務從我的PHP文件發送短信發送短信,但無法發送短信後,用db驗證名稱。這裏是我的代碼:在使用Kannel的獲取,網址
$to=$_GET['sender'];
$username=$_GET['name'];
//verifying received username
if($getusername = mysql_fetch_array(mysql_query("SELECT count(*) as count FROM tablename where username ='".$username."'", $DB))) {
if ($getusername['count']==0) {
header("Location: http://localhost:13013/cgi-bin/sendsms?username=kanneluser&password=foo&to=".$to."&text=Wrong User name, Please SMS valid user name!");
}
else {
header("Location: http://localhost:13013/cgi-bin/sendsms?username=kanneluser&password=foo&to=".$to."&text=text here!");
}
}
我是否以真實的方式調用URL? 非常感謝您的幫助!
嘗試使用'urlencode'爲「文本」參數 – k102
的價值此外,使用像'file_get_contents'使從服務器的HTTP調用。如果您使用位置重定向,則HTTP調用將從客戶端瀏覽器進行。 – pilsetnieks