Search php page

Newbie started to learn PHP.
I am trying to write a php page that people can type in the “case” number in the web site form. That number will send to php page when user user hit submit and the php page will run the query and send result to result page.
I hope I make my statement clear.
I created the page that I can add, delete and view all the cases. But I want to add search so it would sort out other cases.

Thank you.

Usually it’s good to use GET for this kind of thing.

Example:

search form use method GET to file case.php, user typing in case id 12345 will be sent to yoursite.com/case.php?id=12345

case.php run a sql query like: SELECT * FROM case WHERE id = $_GET[‘id’]
(remember to use parameterized queries)

If no result then show a “could not find case” message.
If you did find the case then display the case info.

Sponsor our Newsletter | Privacy Policy | Terms of Service