Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery Ajax Get external url error
    text
    copied!<p>verify.php</p> <pre><code>&lt;?php header('Content-type: application/json'); include 'config.php'; $con = mysqli_connect($db_host, $db_user, $db_pwd, $database); $key1 = $_GET['key1']; $name = $_GET['name']; $email = $_GET['email']; $phone = $_GET['phone']; $address = $_GET['address']; $installations = mysql_query("SELECT * FROM installations where Key1 = '$key1'"); if ($installations !== FALSE &amp;&amp; mysql_num_rows($installations) &gt; 0) { while ($row = mysql_fetch_array($installations)) { $key2 = $row['Key2']; $status = $row['Status']; if ($status == 0) { $sql = "UPDATE installations SET Name = '$name', Email = '$email', Address = '$address', Phone = '$phone',Status = '1' WHERE Key1 = '$key1'"; mysqli_query($con, $sql); $data = array('key1' =&gt; $key1, 'key2' =&gt; $key2); echo(json_encode($data)); } else { $data = array('key1' =&gt; 'key not valid', 'key2' =&gt; 'key not valid'); echo(json_encode($data)); } } } else { $data = array('key1' =&gt; 'key not valid', 'key2' =&gt; 'key not valid'); echo(json_encode($data)); } ?&gt; </code></pre> <p>My Script</p> <pre><code>jQuery.ajax({ type : "GET", url : "http://example.com/verify.php", data : { name : name, email : email, address : address, phone : phone, key1 : key1 }, cache : false, success : function(data) { jQuery.ajax({ type : "GET", url : "admin/check_verification.php", data : { key1 : data.key1, key2 : data.key2 }, cache : false, success : function(response) { $('.message_outer').fadeIn('slow').html(response); window.setTimeout(function() { location.reload(); }, 2000); } }); }, error : function(jqXHR, exception) { if (jqXHR.status === 0) { alert('Not connect.\n Verify Network.'); } else if (jqXHR.status == 404) { alert('Requested page not found. [404]'); } else if (jqXHR.status == 500) { alert('Internal Server Error [500].'); } else if (exception === 'parsererror') { alert('Requested JSON parse failed.'); } else if (exception === 'timeout') { alert('Time out error.'); } else if (exception === 'abort') { alert('Ajax request aborted.'); } else { alert('Uncaught Error.\n' + jqXHR.responseText); } } }); </code></pre> <p>I got 'Not connect , verify network' error. but data (name,email,address,phone,key1) saved in my server database. I'm successfully tested this code with my localhost. how can I fix this error. please help me.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload