Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Ajax, in addition of being a hero of the trojan war according to greek mythology... is the technology you need, and also your friend.</p> <p>I recommend to use jQuery [As Barry has posted faster than me, because I wanted to make sure I got the mythology reference right...]</p> <p>And as MaxArt has pointed out, there are actually two greek heroes named "Ajax", both did participate in the trojan war (and both in Homer's Iliad).</p> <hr> <p>You can use jQuery like so:</p> <pre><code>&lt;!-- Link jQuery (replace src with the location where you have jQuery) --&gt; &lt;script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"&gt; &lt;/script&gt; &lt;!-- Try something like this [having jQuery linked]: --&gt; &lt;script type="text/javascript"&gt; function doButtonStuff() { //Use jQuery to "hide some contents" $('#stufftohideId').hide(); //stufftohideId identifies what to hide //set the url of the web page that will take this info on your server var ulr = "http://localhost"; //The following part will fail if you cannot connect to the server $.post( url, {text: $('#textboxId').val()}, //textboxId identifies the textbox function (data) { //data is what the server responded //do something with data, for instance: alert(data); } ); } &lt;/script&gt; &lt;input type="text" id="textboxId"&gt;&lt;/input&gt; &lt;input type="button" onclick="doButtonStuff();" value="Click Me"&gt;&lt;/input&gt; &lt;div id="stufftohideId"&gt; &lt;p&gt; This is an example of something to hide. &lt;/p&gt; &lt;/div&gt; </code></pre> <p>You will get on the server side, of the web page with the url you passed like so:</p> <pre><code>&lt;?php $text = $_POST['text']; ?&gt; </code></pre> <p>Make sure to verify the request method, for example:</p> <pre><code>&lt;?php if ($_SERVER['REQUEST_METHOD'] == 'POST') { $text = $_POST['text']; //do something with $text, for instance: echo $text; } ?&gt; </code></pre> <p>And also to validate and sanitize the input. If a session is required verify that too. Whatever the server returns, will be recieved in the client side.</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