I have a form containing the following: <form action="main.php?page=home" method="post">by search: <input name="search" type="text" /> <input type="submit" value="Go" /></form> Code (markup): when someone uses this form I want to the url to be something like: www.mydomain.com/main.php?page=home&seach=<whaever the user typed> what I am getting is: www.mydomain.com/main.php?seach=<whaever the user typed> Code (markup): .. its losing the “?page=home†bit Any way around this?
you may append the string page=home when you process the string in main.php FORM action is NOT used to pass arguments, it just indicates which page is going to be invoked for processing the form, and thus drops anything after the page name . An alternative would be to use <input type=hidden name=page value=home> within your form. HTH
Change: <form action="main.php?page=home" method="post"> To: <form action="main.php" method="get"> and add the page as a hidden tag. Peace,
<form method="POST" action="main.php"> <input type="hidden" name="page" value="home"> <input type="submit" value="Go!"> </form> HTML: