$username Posted May 7, 2008 Share Posted May 7, 2008 Hello All, Ok, I dont know if this is posible, but I am trying to have a form files and then the submit button will then pass the vars in the url. Here is an example. <form action="" class="searchform"> <p> <input name="SrchString" class="textbox" type="text" /> <input class="button" value="Search" type="submit" /> </p> </form> ?search=1&SrchString=txt Is this posible? Thanks, Brett Link to comment https://forums.phpfreaks.com/topic/104586-how-to-use-a-submit-button-to-pass-vars-in-a-url/ Share on other sites More sharing options...
pocobueno1388 Posted May 7, 2008 Share Posted May 7, 2008 Are you sure it's not already? Since you don't have the "method" attribute set on the form it should by default be "get". Try <form action="" class="searchform" method="get"> Link to comment https://forums.phpfreaks.com/topic/104586-how-to-use-a-submit-button-to-pass-vars-in-a-url/#findComment-535316 Share on other sites More sharing options...
$username Posted May 7, 2008 Author Share Posted May 7, 2008 Well it is adding only one var to the url, I need 2. ?search=1&SrchString=txt Brett Link to comment https://forums.phpfreaks.com/topic/104586-how-to-use-a-submit-button-to-pass-vars-in-a-url/#findComment-535320 Share on other sites More sharing options...
kenrbnsn Posted May 7, 2008 Share Posted May 7, 2008 You need to add another field to your form named "search" with a value of 1. BTW, this is a pure HTML question and has nothing to do with PHP. Ken Link to comment https://forums.phpfreaks.com/topic/104586-how-to-use-a-submit-button-to-pass-vars-in-a-url/#findComment-535322 Share on other sites More sharing options...
$username Posted May 7, 2008 Author Share Posted May 7, 2008 Thanks for the help I just found the example. Sorry for the posting in the wrong board. Brett Link to comment https://forums.phpfreaks.com/topic/104586-how-to-use-a-submit-button-to-pass-vars-in-a-url/#findComment-535325 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.