How to make a search engine form to search posts on my website?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jamesmoore
    New Member
    • Jan 2011
    • 47

    How to make a search engine form to search posts on my website?

    Hi,

    I have a job board and I am unsure of how to make a search form like other job boards so people can chose their needs then click search to search the posts on a webpage to then show the posts that meet the search criteria.

    Thanks,

    James
  • JKing
    Recognized Expert Top Contributor
    • Jun 2007
    • 1206

    #2
    Do you have a database?

    A search is performed on a database using a combination of a server side language and some sql to pull data related to the user's input.

    Comment

    • Bharat383
      New Member
      • Aug 2011
      • 93

      #3
      for searching facility to user you must have to use any server side script as well as database to store details about searching data.

      if you are using php ::

      <form name="form1" method="post">
      <input type="text" name="search_bo x" value=""> <input type="submit" name="submit" value="Search Job">
      </form>

      <?php
      if(isset($_POST['submit']))
      {
      $search_text = $_POST['search_box'];

      // make query to search
      $qry = "select * from job_details where title like '%$search_text% '";
      $query = mysql_query($qr y) or die(mysql_error ());

      //fetching or getting details and display it
      while($row = mysql_fetch_arr ay($query))
      {
      echo "<div>";
      echo $row['title'];
      echo "</div>";
      }
      }
      ?>

      Bharat Parmar(Bharat38 3)

      Comment

      Working...