damerit Posted August 19, 2008 Share Posted August 19, 2008 How do I pass the text contents of page1.html to page2.php with out using a form. I tried the onclick event with no luck... page1.html <input type="text" name="search" onclick="window.open('page2.php')" /> page2.php <?php $search = $_GET['search']; echo $search; ?> Quote Link to comment https://forums.phpfreaks.com/topic/120407-how-to-pass-text-contents-without-using-a-form/ Share on other sites More sharing options...
wildteen88 Posted August 19, 2008 Share Posted August 19, 2008 Use a normla link? <a href="page2.php?search=all>Search All</a> In page2.php use $_GET['search'] to retrieve the search url variable. Quote Link to comment https://forums.phpfreaks.com/topic/120407-how-to-pass-text-contents-without-using-a-form/#findComment-620383 Share on other sites More sharing options...
damerit Posted August 19, 2008 Author Share Posted August 19, 2008 That does work. My objective is for a user to type criteria in a text field and when they submit or activate the event the typed contents would be sent to page2.php. That is where I will perform a search on the content. thank you, Quote Link to comment https://forums.phpfreaks.com/topic/120407-how-to-pass-text-contents-without-using-a-form/#findComment-620397 Share on other sites More sharing options...
wildteen88 Posted August 19, 2008 Share Posted August 19, 2008 You wont be able to do that with out a form. Quote Link to comment https://forums.phpfreaks.com/topic/120407-how-to-pass-text-contents-without-using-a-form/#findComment-620414 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.