Search box code in html
I am looking for some code to add to the one below...what i would like to do is be able to type in a word such as "contact" in a search box click go and have it take me to the contact page...the code below does do that but how can i repeat it with more links and keywords.
so in a nut shell i would like to enter keywords in the search box and have it take me to a specific page
thanks in advance
<form id="search" action="http://websitedesignsonly99dollars.weebly.com/contact.html">
<input name="contact""about" type="contact" size="20" />
This can't be done in just HTML, you need to use PHP. Your form will obviously take you to the contact page as that is where the form data is sent to (specified in your form action). Also, you don't need a link for your Search as this should be a submit button which will then go to the page specified in your form action.
The basics of your form would be
And then on search.php you will need to get the value of $_POST['keyword'] and either query a list of pages in a database or in an array and if it exists redirect the person to that page. I cannot give you the code as it depends on how you plan for this to work and if you know PHP.
<form id="search" method="post" action="search.php">
<input name="keyword" type="text" size="20" />
<input type="submit" name="submit" valeu="Search">
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)