Php 使用sms api时,结果不显示在Json中

Php 使用sms api时,结果不显示在Json中,php,json,Php,Json,然后JSON不会成功,也不会显示验证代码的输入 不知道问题在哪里 用于验证编号的功能 $url='http://1.1.1.1/sendsms.jsp?user=test&password=test&mobiles='.$mob_no.'&sms='.urlencode(MESSAGE .$key).'&senderid='.SENDER.'&response=json'; 功能验证\移动\否() { var key=$.trim($('#验证_key

然后JSON不会成功,也不会显示验证代码的输入

不知道问题在哪里

用于验证编号的功能

$url='http://1.1.1.1/sendsms.jsp?user=test&password=test&mobiles='.$mob_no.'&sms='.urlencode(MESSAGE .$key).'&senderid='.SENDER.'&response=json';
功能验证\移动\否()
{ 
var key=$.trim($('#验证_key').val());
var-verification_-id=$('#verification_-id').val();
如果(键==“”)
{
$('v#u msg').html(“请输入验证码!!”);
}
其他的
{
var uniqid=$('#uniqid').val();
$.ajax({
方法:'post',
url:'ajax_call.php',
数据:{'verification_key':key,'v_id':verification_id}
})
.done(函数(msg){
$('v#u msg').html(“”);
$('#result').html('

'+msg+”

'); setTimeout(“location.reload(true);”,7000); }); } }
结果显示为

  function verify_mobile_no()
{ 
    var key = $.trim($('#verification_key').val());
    var verification_id = $('#verification_id').val();
    if(key == "") 
    {
        $('#v_msg').html("<span style='color:red'>Please, Enter Verification Code!!</span>");
    }
    else
    {
        var uniqid=$('#uniqid').val();
        $.ajax({
            method:'post',
            url:'ajax_call.php',
            data:{'verification_key':key,'v_id':verification_id}
        })
        .done(function(msg){
                $('#v_msg').html("");
                $('#result').html('<p style="font-size:30px;">'+msg+'</p>');
                setTimeout("location.reload(true);", 7000);
        });
    }
}

请问问题出在哪里


注意:我的sms api没有身份验证密钥,没有通过用户和pass路由,所以我使用上面的方法。

当您硬编码链接,然后直接在浏览器中运行链接时会发生什么情况可能您的sms api的输出结果与第一个不同@DhavalChheda我在手机中收到短信,并将数据插入数据库,但输入未打开以插入代码verify@pejmankheyri输出是指插入代码的输入框,如果我正在使用SMS API,则不会显示该输入框,因为它无法通过success@anupdwivedi所以你的短信发送和数据插入数据库?!
  function verify_mobile_no()
{ 
    var key = $.trim($('#verification_key').val());
    var verification_id = $('#verification_id').val();
    if(key == "") 
    {
        $('#v_msg').html("<span style='color:red'>Please, Enter Verification Code!!</span>");
    }
    else
    {
        var uniqid=$('#uniqid').val();
        $.ajax({
            method:'post',
            url:'ajax_call.php',
            data:{'verification_key':key,'v_id':verification_id}
        })
        .done(function(msg){
                $('#v_msg').html("");
                $('#result').html('<p style="font-size:30px;">'+msg+'</p>');
                setTimeout("location.reload(true);", 7000);
        });
    }
}
<div id="result" style="margin:20px auto; text-align:center;"></div>