Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I recommend you use jQuery, instead of creating XmlHttpRequest objects manually, as it manages to solve some compatibility issues between browsers, and makes the whole thing way simpler.</p> <p>With jQuery, you will be able to do the request using something like this:</p> <pre><code>$.post({ url: "http://example.com/....", data: {"username": "your_user_here", "password": "your_password_here"}, success: function(){ alert('Success!'); } }); </code></pre> <p>Anyways, there are a lot of options there and the topic is quite long to fit in a SO answer, so I recommend you have a look at the jQuery Ajax documentation here: <a href="http://api.jquery.com/category/ajax/" rel="nofollow">http://api.jquery.com/category/ajax/</a></p> <p>and in particular this: <a href="http://api.jquery.com/jQuery.ajax/" rel="nofollow">http://api.jquery.com/jQuery.ajax/</a></p> <h2>Update</h2> <p><del>The only problem here is that php usually expects to receive data in form-encoded format, but with this your script will get json data.. (so, expect <em>not</em> to be able to use <code>$_POST</code>) with other languages (python, nodejs, ..) this is not a problem; I don't know how to handle this with php but I'm pretty confident there's a way to do that. Of course, you can fallback on sending form-encoded data, but JSON is the de-facto standard for these things nowdays..</del></p> <p>Sorry, I was remembering incorrectly, but the default behavior of jQuery is to urlencode the POST data, so you'll be fine with reading values from <code>$_POST</code>, when doing requests with the code above..</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

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