e1seix Posted August 29, 2007 Share Posted August 29, 2007 OK, it's pretty self-explanatory but when I have a form in my PHP scripting I'm trying to figure out a way of sending what the user enters to the end of the address bar in the new page that opens when the form is submitted: echo '<form action="/search.php?result=$result" method="post">'; echo '<a href="/">Home</a> | '; echo '<a href="/whatsnew.php?startrow=0">What's New</a> | '; echo '<a href="/newsletter.php">Newsletter</a> | '; echo 'Search: <input type="text" name="search">'; echo '<input type="submit" value="Go!">'; echo '</form>'; I need $result to equal what the user enters to use the GET_$result code on the search.php page. Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/67267-send-data-submitted-by-user-in-form-to-address-bar/ Share on other sites More sharing options...
trq Posted August 30, 2007 Share Posted August 30, 2007 Set your forms method to GET. Quote Link to comment https://forums.phpfreaks.com/topic/67267-send-data-submitted-by-user-in-form-to-address-bar/#findComment-337436 Share on other sites More sharing options...
roopurt18 Posted August 30, 2007 Share Posted August 30, 2007 What thorpe said is probably the best approach, I just wanted to point out you can only use variables inside of double quoted strings and not single quoted strings like in your code. Quote Link to comment https://forums.phpfreaks.com/topic/67267-send-data-submitted-by-user-in-form-to-address-bar/#findComment-337442 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.