CORT0619 Posted December 24, 2012 Share Posted December 24, 2012 (edited) So, I'm using the get request to send values input by the user through the url to another page: <a href="tms.php?ticket_num=$ticket_num&name=$name&email=$email&phone=$phone&problem=$problem&tech=$tech"><input type="submit" value="Search" /></a> however, once I click the above button the url reads: <form>http://localhost/get?ticket_num=1234&name=Tiffany+Happy&email=tharmon15%40gmail.com&phone=3523453643&problem=hardware+issue&tech=Calvin+Schaffer</form> So, I'm wondering why the url changes to get? instead of tms.php? Thanks, -Crystal. Edited December 24, 2012 by CORT0619 Quote Link to comment https://forums.phpfreaks.com/topic/272326-using-the-get-request/ Share on other sites More sharing options...
MDCode Posted December 24, 2012 Share Posted December 24, 2012 (edited) I believe forms overrule links (not sure). Since you have a submit button I'm assuming you have a form so, you will need to post the opening <form> tag Edited December 24, 2012 by SocialCloud Quote Link to comment https://forums.phpfreaks.com/topic/272326-using-the-get-request/#findComment-1401096 Share on other sites More sharing options...
CORT0619 Posted December 24, 2012 Author Share Posted December 24, 2012 Well i have the opening and closing form tags as well as get as the action and search.php as the method which is the current page. Quote Link to comment https://forums.phpfreaks.com/topic/272326-using-the-get-request/#findComment-1401097 Share on other sites More sharing options...
MDCode Posted December 24, 2012 Share Posted December 24, 2012 You have action and method mixed up. Action is the page you want the form to go to. Method is what process you want to use, most common use is post and get Quote Link to comment https://forums.phpfreaks.com/topic/272326-using-the-get-request/#findComment-1401099 Share on other sites More sharing options...
Christian F. Posted December 24, 2012 Share Posted December 24, 2012 Also, you need to use the URL in the first post as the action, as that's where the form's content will be posted. You cannot do both at the same time, unless you override the standard submit event and add some AJAX to it. Quote Link to comment https://forums.phpfreaks.com/topic/272326-using-the-get-request/#findComment-1401114 Share on other sites More sharing options...
Barand Posted December 24, 2012 Share Posted December 24, 2012 Either Remove the submit button and replace it with the string "Search" or Put the search values in form elements (text boxes or hidden fields) and use the form to search (once you have the method and actions the right way round Quote Link to comment https://forums.phpfreaks.com/topic/272326-using-the-get-request/#findComment-1401123 Share on other sites More sharing options...
CORT0619 Posted December 25, 2012 Author Share Posted December 25, 2012 Thanks alot to everyone who responded. I'm on the right track! Quote Link to comment https://forums.phpfreaks.com/topic/272326-using-the-get-request/#findComment-1401198 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.