Need a Html search box

Discussion in 'HTML & Website Design' started by Mr.tyro, Dec 7, 2006.

  1. #1
    How do i add a search function to my site. Does anyone have a code in html?

    edit: if i add the google search function to my site its going to look abit akward. Can i change it and jsut keep the code
     
    Mr.tyro, Dec 7, 2006 IP
  2. rgchris

    rgchris Peon

    Messages:
    187
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    <form method = 'post' action = 'xxx.com'>
    Search: <input type = 'text' name = 'searchbox'><br>
    <input type = 'submit'>
    <form>
    Code (markup):
    Something like that. Then you need something handle the post variables.
     
    rgchris, Dec 7, 2006 IP
  3. Mr.tyro

    Mr.tyro Guest

    Messages:
    525
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3

    um you know where it says
    'post' action = 'xxx.com'>
    Code (markup):
    what do i replace it with and what do you meen by variables. rusty on my html abit

    Edit: how do i actualy make it work?
    How do i make it search and how do i make do all the thigns that a search button would do.

    If i put in the whole code it makes my template jump like crazy.
    but if remove this part its all good
    'post' action = 'xxx.com'>
    Code (markup):
    how would i fix this
     
    Mr.tyro, Dec 7, 2006 IP
  4. rgchris

    rgchris Peon

    Messages:
    187
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Change the 'xxx.com' to the website you want to go to once the submit button is pressed.

    The 'post variable' I was referring to would be the search term that the user entered. I was just saying that you'd need another programming language to do anything of meaning with it (ie PHP, etc).
     
    rgchris, Dec 7, 2006 IP
  5. oseymour

    oseymour Well-Known Member

    Messages:
    3,960
    Likes Received:
    92
    Best Answers:
    0
    Trophy Points:
    135
    #5
    you need more than just an html search box to search your site.
     
    oseymour, Dec 7, 2006 IP
  6. rgchris

    rgchris Peon

    Messages:
    187
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #6
    It depends on how everything is set up.
     
    rgchris, Dec 7, 2006 IP
  7. swirl1980

    swirl1980 Peon

    Messages:
    53
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    javascript?

    have a look at google....
     
    swirl1980, Dec 8, 2006 IP
  8. Mr.tyro

    Mr.tyro Guest

    Messages:
    525
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #8
    ok if put this in
    Search: <input type = 'text' name = 'searchbox'><br>
    <input type = 'submit'>
    <form>
    Code (markup):
    What else or what scrpt do i have to put it for this search box to work becouse i have googled alot of stuff and it all doesent work
     
    Mr.tyro, Dec 8, 2006 IP
  9. SpringCypress

    SpringCypress Well-Known Member

    Messages:
    316
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    108
    #9
    this is a little more than what you're asking for, but I've had great results with this search script...

    http://www.xav.com/scripts/search/

    It's a cgi script, so requires an install, but if you can't or don't want to do it yourself they've got an automated install that you can perform from there. After it's installed it gives you the HTML that you need to place in your pages...
     
    SpringCypress, Dec 8, 2006 IP
  10. Mr.tyro

    Mr.tyro Guest

    Messages:
    525
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Could i jsut add gogole search change some html and make it only searchable on my site . could i do that or is it bracking somesort of google copyright laws?

    <!-- SiteSearch Google -->
    <FORM method=GET action="http://www.google.com/search">
    <input type=hidden name=ie value=UTF-8>
    <input type=hidden name=oe value=UTF-8>
    <TABLE bgcolor="#FFFFFF"><tr><td>
    <A HREF="http://www.google.com/">
    <IMG SRC="http://www.google.com/logos/Logo_40wht.gif" 
    border="0" ALT="Google"></A>
    </td>
    <td>
    <INPUT TYPE=text name=q size=31 maxlength=255 value="">
    <INPUT type=submit name=btnG VALUE="Google Search">
    <font size=-1>
    <input type=hidden name=domains value="YOUR DOMAIN NAME"><br><input type=radio name=sitesearch value=""> WWW <input type=radio name=sitesearch value="YOUR DOMAIN NAME" checked> YOUR DOMAIN NAME <br>
    </font>
    </td></tr></TABLE>
    </FORM>
    <!-- SiteSearch Google -->
    
    Code (markup):
     
    Mr.tyro, Dec 8, 2006 IP
  11. SpringCypress

    SpringCypress Well-Known Member

    Messages:
    316
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    108
    #11
    google search for just your domain will work just fine. it's not against their tos.
     
    SpringCypress, Dec 8, 2006 IP