1
function curl_request($url=false)
{
$ch=curl_init();
if($url)
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_HTTPGET, true);
curl_setopt($ch, CURLOPT_USERAGENT);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
return $result;
}
$data['update']=false;
$data['msg']='Record not found.';
switch($_POST['action']){
case "validateAccountNumber" :
$sql="SELECT user_id FROM tbl_user WHERE ".$_POST['fieldName']."='".$_POST['fieldValue']."'";
$result = mysql_query ($sql);
if(mysql_num_rows($result)){
$_SESSION['account_no'] = $_POST['fieldValue'];
$data['update']=true;
$data['msg']='Record found.';
}
break;
case "validateMobileNumber" :
$sql="SELECT user_id FROM tbl_user WHERE ".$_POST['fieldName']."='".$_POST['fieldValue']."' AND account_no='".$_SESSION['account_no']."'";
$result = mysql_query ($sql);
if(mysql_num_rows($result)){
$_SESSION['mobile_no'] = $_POST['fieldValue'];
//
$sms_code= makePin();
$_SESSION['sms_code'] = $sms_code;
///////////////////// Sengin Sms Code //////////////////////////
$message = "Dear Member, your activation code is $sms_code. Thanks for registering, from www.chsonline.in.";
$username = "xxxxxxxxxx";
$password = "zzzzzzzzzz";
$sendername = "chsonline";
$url = "http://bulksms.mysmsmantra.com:8080/WebSMS/SMSAPI.jsp?username=".$username."&password=".$password."&sendername=".$sendername."&mobileno=91".$_SESSION['mobile_no']."&message=".urlencode($message);
$data['sms_response'] = curl_request($url);
$data['sms'] = $url;
////////////////////////////////////////////////////////////////
$data['update']=true;
$data['msg']='A verification code have been sent in your mobile no.';
}
break;
default:
break;
}
echo json_encode($data);
die();
}
部份上發送是一個PHP代碼:當我使用此代碼發送短信,上本地主機其發送短信,但在線服務器上其不僅發送短信此通知給出PHP,捲曲短信與現場服務器
- 驗證碼已在您的手機號碼中發送。
代碼執行正確,但沒有短信發送。 我的託管或域名與Godaddy.in
只有這段代碼不工作,其他的curl php短信程序工作正常。 –
我創建了一個短信發送程序,手動輸入消息或接收號碼發送成功完全 –
https://chsonline.in/phpinfo.php –