PHP/Javascript/AJAX - Redirect page with a form, and then submit it -


i've been making webpage gathers tweets depending on input on form , i'm having problems using default form submit.

i want change how form submit works might take ages page redirect , give user token id, due php script executing. make things simple thought best way make faster redirecting , submitting form. unfortunately don't think can php.

someone recommended me give @ ajax, didn't how me.

this how form looks like:

<form action="testing.php" method="post">     <input type="text" name="search" value="" placeholder="all of these words" autofocus/><br>     <input type="text" name="search2" value="" placeholder="this exact word or phrase" /><br>     <input type="text" name="search3" value="" placeholder="any of these words" /><br>     <input type="text" name="search4" value="" placeholder="none of these words" /><br>     <input type="text" name="count" value="" placeholder="number of tweets search" />      <select name="lang">         <option value="">- tweets language -</option>         <option value="all">all</option>         <option value="en">english</option>         <option value="es">spanish(espaƱol)</option>     </select>      <select name="region">         <option value="">- choose region -</option>         <option value="all">all</option>         <option value="africa">africa</option>         <option value="namerica">north america</option>         <option value="samerica">south america</option>         <option value="asia">asia</option>         <option value="europe">europe</option>         <option value="oceania">oceania</option>     </select>      <input type="submit" value="search" class="special" /> </form> 

ajax best way it.

if don't know how use ajax, can try setting action value $_server['php_self'] , on same page put php code this:

<?php  if(isset($_post['submit']))   {    //phpcode   }  ?>   //form code 

this 1 way it. or can read ajax , implement that.


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -