php - Result Not Display in Json when use sms api -
$url='https://mysmsapi.com/api/sendhttp.php?authkey='.authkey.'&mobiles='.$mob_no.'&message='.urlencode(message .$key).'&sender='.sender.'&response=json&route='.route; $ch = curl_init($url); curl_setopt($ch, curlopt_header, false); curl_setopt($ch, curlopt_returntransfer, 1); $resp = curl_exec($ch); $json = json_decode($resp); if($json->type == 'success') { mysql_query("insert mobile_sms_verifier_data(mobile_no,email,name,verification_key) values('$mob_no','$email','$name','$key')"); $id = mysql_insert_id(); $responce = '<table align="center" border="1"><tr><td align="center">enter verification code</td></tr><tr><td align="center"><input type="hidden" value="'.$id.' " id="verification_id"><input type="text" id="verification_key" maxlength="5" placeholder="verification code"></td></tr><tr><td align="center"><input type="button" value="confirm" onclick="verify_mobile_no()"><p id="v_msg"></p></td></tr></table>'; } elseif($json->type == 'error') { $responce = '<p style="text-align: center;color:red;">please enter valid mobile no. <a href=""> try again </a></p>'; } echo $responce; die(); }
its working fine when using sms api
$url='http://1.1.1.1/sendsms.jsp?user=test&password=test&mobiles='.$mob_no.'&sms='.urlencode(message .$key).'&senderid='.sender.'&response=json';
then json not gets success , not display input verify code.
no idea issue...
funtion use verify no.
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); }); } }
result show as
<div id="result" style="margin:20px auto; text-align:center;"></div>
please me issue ??
note : sms api dont have auth key , route user , pass use above.
Comments
Post a Comment