This is definately a novice question, but if you could be of any help i would be very grateful.
Basically, i'm building a database management page, and it of course includes a search function.
So, the search form looks something like this
But, whenever i use it, i will of course get redirected to search.php. What i want is a way to display the results on the same page i did the search from (let's say index.php), without having to build an entire identical page around search.php
Thankful for answers.
解决方案
Use a hidden field in the form that indicates that the form has been submitted.
In your form page (e.g. index.php)
{OTHER_FORM_FIELDS}
So in your php code (could be in the index.php page or in a php script included)
if($_POST['doSearch']==1) {
//query database
//get results
} ?>
in your index.php page
HTML_CODE