gdfhghjdfghgfhf Posted May 18, 2008 Share Posted May 18, 2008 i have just finished creating a search script you can search for an entry inside the database by accessing search.php?query=YOURSEARCHHERE but now i have a stupid question how do i create the html form that will process the search? basically i need to make a form with a text input and a send button when send button is hit, the browser will go to the URL i mentionned above, where "YOURSEARCHHERE" is the words the user have entered inside of the text input Link to comment https://forums.phpfreaks.com/topic/106117-html-search-form-for-my-php-search-script/ Share on other sites More sharing options...
947740 Posted May 18, 2008 Share Posted May 18, 2008 <html> <!-- The form --> <form name='form' action='redirect.php' method='post'> <input type='text' name='query' /><br /> <input type='submit' name='submit' value='Search!' /> </form> </html> <?php // redirect.php $query = $_POST['query']; header("Location: search.php?query=$query"); ?> *Not tested Link to comment https://forums.phpfreaks.com/topic/106117-html-search-form-for-my-php-search-script/#findComment-543908 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.