Searching data

I have a form with a few text fields and 2 image fields. Now after the form is filled, I want to the users to be able search based on the text fields
I am lost after I set up my forms. I know that this question maybe a very long to answer. So I just need a tutorial or an example on how this is done so i can change it around and to fit my site.

So my main goal is:

  1. To have a form
  2. To have the users fill out the form
  3. Store the data
  4. Allow the users to search all the data.

I have the html and php files.

here is my html.

Text Field One:

Text Field Two:

Text Field Three:

Image Field One:

Image Field Two:

here is my php.

Text Field One: <?php echo $_POST["one"]; ?>

Text Field Two: <?php echo $_POST["two"]; ?>

Text Field Three: <?php echo $_POST["three"]; ?>

Image Field One: <?php echo $_POST["image_one"]; ?>

Image Field two: <?php echo $_POST["image_two"]; ?>

How are you going to store the data? I would suggest in a database as that makes things much easier.

Then you need only develop a query to “Search” the database and retrieve the requested/searched data.

Alternatively, you can use google itself to search your site. There used to be a way to do it for free, but I think they now have a “Pay for Searches” method now. (something like $100 / 50,000 queries / year)

I am not familiar in how to store it in a database or make a query. Can you give me an example or lead me to a tutorial?

GotPHP, is a decent tutorial which provides information about databases and examples. The examples show methods of querying the database to insert, update and delete information.

Hope this helps.


Thanks thats a lot of help. I will work on it and come back later.

Sponsor our Newsletter | Privacy Policy | Terms of Service