Click here to Skip to main content
15,900,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everyone,

I'll just go straight to the point here, basically I'm trying to run a search using PHP on my index page, and when I press ENTER after typing in the search box, I need a different page to appear, with the results of the search in a table.

The difference is, the page with the table already loads with information in it from a small MYSQL query with PHP.

Is there a way to make it possible????

Comments and answers are much appreciated.
Regards,

Tom.
Posted

In the form, change ACTION to the page thaT the table is on, and change the METHOD to GET rather than post.
 
Share this answer
 
i would redirect that page with javascript after a user enters their search query

window.location.href="//secondpage.php?search=searchvalue";

then on the server side of the page i would check if the query string search has a value

if query string search has value then do not run your small MySQL query and run you search query instead

else if query string search variable does not have a value then run your small MySQL query
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900