SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru laflair13's Avatar
    Join Date
    Nov 2004
    Location
    TN
    Posts
    626
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Search feature for website

    I have searched google but cannot find a good source for this.

    I want to add a search box on a website that searches the database and puts the results on a page like results.php or something.

    Can anyone lead me in the right direction? Sites made with php and mysql

    Thanks
    Thanks In Advance

    David

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,506
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    Are you sure googling something like this doesn't give you any good source to start working with?
    http://www.google.com/search?hl=en&q...search+feature

  3. #3
    SitePoint Member
    Join Date
    Apr 2012
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just catch user input in search field and past it in mysql query... Oh, no, better use PDO for this. And dont forget to verify this input.

  4. #4
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,299
    Mentioned
    460 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by laflair13 View Post
    I want to add a search box on a website that searches the database and puts the results on a page like results.php or something.
    As a side note, I never find that these work very well. Even though it's not as pretty, I prefer to put a Google search form on my sites. You get much more thorough results. E.g.

    Code:
    	<form method="get" action="http://www.google.com/search">
    		<label for="q">Search this Site</label> 
    		<input type="text" class="text" name="q" id="q" size="31" maxlength="255" value=""> 
    		<input class="submit" type="submit" value="Search">
    		<input type="hidden" name="sitesearch" value="mysite.com">
    	</form>
    (Make sure to put your own domain in place of mysite.com.)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •