joethetree Posted April 11, 2011 Share Posted April 11, 2011 Hey, I'm trying to send a form input to a page, and then get the response (as in, the body) from that page without leaving my PHP script. So instead of when you normally submit a form and it will take you to the 'action="/somepage"'. I want it to get that information and bring it back to the original page. No navigation should happen. I'm almost certain this is possible, but the only thing I've found at the moment requires a custom addon - which, isn't on most hosting sites. Sorry if I haven't described this very well, but any help would be appreciated Thanks tree Quote Link to comment https://forums.phpfreaks.com/topic/233337-sendreceive-data/ Share on other sites More sharing options...
QuickOldCar Posted April 11, 2011 Share Posted April 11, 2011 <form name="input" action="" method="get"> You leave the action empty. Use w/e method you use. Quote Link to comment https://forums.phpfreaks.com/topic/233337-sendreceive-data/#findComment-1199929 Share on other sites More sharing options...
joethetree Posted April 11, 2011 Author Share Posted April 11, 2011 I still need to send the request to another script, just not go to that script. So I need the data back from the request, like doing a file_get_contents() on the page, but with the response from a submitted form. tree Quote Link to comment https://forums.phpfreaks.com/topic/233337-sendreceive-data/#findComment-1200123 Share on other sites More sharing options...
QuickOldCar Posted April 11, 2011 Share Posted April 11, 2011 Then using ajax is the answer. http://www.w3schools.com/Ajax/default.asp Quote Link to comment https://forums.phpfreaks.com/topic/233337-sendreceive-data/#findComment-1200177 Share on other sites More sharing options...
joethetree Posted April 12, 2011 Author Share Posted April 12, 2011 Ok, thanks a lot Quote Link to comment https://forums.phpfreaks.com/topic/233337-sendreceive-data/#findComment-1200406 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.