$adm=$_POST["admno"];
$phn=$_POST["phn1"];
include("model.php");
$db = new database;
$r=$db->register($adm,$schoolcode);
while($row=mysql_fetch_array($r))
{
if($row["phn_no1"]==$phn || $row["phn_no2"]==$phn || $row["phn_no3"]==$phn)
{
$formatted = "".substr($phn,6,10)." ";
$password = $formatted + $adm;
echo $password;
$db->setpassword($adm,$password,$schoolcode);
$pre = 'Dear%20Parents,Your%20Password%20is%20';
$suf = '%20ThankYou.CV';
$sms = $pre.$password.$suf;
session_start();
?>
<script>
window.onload = function(){
{
$("#active"+id).css({"color":"red"});
var http = new XMLHttpRequest();
var url = "http://www.perfectbulksms.in/Sendsmsapi.aspx?USERID=UID&PASSWORD=UPASS$&SENDERID=SID&TO=<?php echo $phn; ?>&MESSAGE=<?php echo $sms;?>";
var adm = "<?php echo $admno; ?>";
var params = "Id="+ id +"&adm="+adm;
http.open("POST", url, true);
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.onreadystatechange = function() {
if(http.readyState == 4 && http.status == 200) {
//alert(http.responseText);
}
}
http.send(params);
window.location.href="#";
}
};
</script>
<?php
header("Location:password.php?msg=new");
此代码无效..好吧,根据代码更改我的密码但不发送短信..我没有使用curl命令,因为它在localhost上工作正常,但在服务器上它无法工作..