$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上工作正常,但在服务器上不起作用。

最佳答案

这不是正确的方法,如果服务器上没有CURL,请先安装它,然后再使用CURL。

CURL安装过程在此处定义:

Help Doc

Help Doc

09-26 01:38
查看更多