html - Calling a php function after onclick event -


i need help.

this php code shows me table names of people mysql database:

if ($numrows>=1) { echo<<<end <td align="center" bgcolor="e5e5e5">nazwisko</td> </tr><tr> end; } ($i = 1; $i <= $numrows; $i++) { $row = mysqli_fetch_assoc($result); $nazwisko = $row['nazwisko'];     echo<<<end <td align="center">$nazwisko</td> </tr><tr> end;  } 

i want table showed after click on button. html code looks this:

<form class="form-horizontal" role="form" method="post" action="index.php"> <input id="button" name="submit" type="submit" value="szukaj" class="btn btn-info"> 

my efforts in vain. grateful help.

your browser can't interpret php. you'll have make ajax call.

request = $.ajax({     url: "/index.php",     type: "post" });  request.done(function (response){     // append html somewhere on page }); 

Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -