dfowler Posted February 13, 2008 Share Posted February 13, 2008 Hey guys, I have a tough one here. Or at least I haven't been able to figure it out yet. I have created a form that sends data to be processed by an outside vendor. When you submit the form you are sent to their site to view the results in XML. What I am wanting to do, if it is possible, is create some sort of script (which I know nothing about) that will send the form data, be processed, and download the XML report locally then display the information all on the users server. So when the user clicks submit they stay on their server and view the XML report. Here is my code: <form enctype="multipart/form-data" method="post" action="https://www.site.com/process.icp"> Login: <input type="text" name="login" /><br /><br /> Pass: <input type="password" name="pass" /><br /><br /> Number: <input type="text" name="num" /><br /><br /> Number 2: <input type="text" name="num2" /><br /><br /> <input type="submit" name="submit" value="Get Report" /> </form> I'm guessing instead of the form action going to there server I go to another page on my server. Then on that page the script would send it and download the report and display it? Thanks for any help! Link to comment https://forums.phpfreaks.com/topic/90964-download-xml-report/ Share on other sites More sharing options...
Isityou Posted February 13, 2008 Share Posted February 13, 2008 file_get_contents("https://www.site.com/process.icp"); Gets the content of the page. Link to comment https://forums.phpfreaks.com/topic/90964-download-xml-report/#findComment-466200 Share on other sites More sharing options...
dfowler Posted February 13, 2008 Author Share Posted February 13, 2008 file_get_contents("https://www.site.com/process.icp"); Gets the content of the page. How do I send the information though? Link to comment https://forums.phpfreaks.com/topic/90964-download-xml-report/#findComment-466201 Share on other sites More sharing options...
Isityou Posted February 13, 2008 Share Posted February 13, 2008 action="https://www.site.com/process.icp" I thought it was being processed externally? 1. Send the form to be processed 2. Retrieve the results from the external site where the form was processed 3. Display the results locally (origin of where the form was sent) Link to comment https://forums.phpfreaks.com/topic/90964-download-xml-report/#findComment-466209 Share on other sites More sharing options...
dfowler Posted February 13, 2008 Author Share Posted February 13, 2008 I'll run through it again. When you fill out the form it goes to their site and displays the XML. I'm hoping to avoid that. Instead of: <form enctype="multipart/form-data" method="post" action="https://www.site.com/process.icp"> Login: <input type="text" name="login" /><br /><br /> Pass: <input type="password" name="pass" /><br /><br /> Number: <input type="text" name="num" /><br /><br /> Number 2: <input type="text" name="num2" /><br /><br /> <input type="submit" name="submit" value="Get Report" /> </form> I want to do this: <form enctype="multipart/form-data" method="post" action="page2.php"> Login: <input type="text" name="login" /><br /><br /> Pass: <input type="password" name="pass" /><br /><br /> Number: <input type="text" name="num" /><br /><br /> Number 2: <input type="text" name="num2" /><br /><br /> <input type="submit" name="submit" value="Get Report" /> </form> Then on page 2 display the XML results. Link to comment https://forums.phpfreaks.com/topic/90964-download-xml-report/#findComment-466215 Share on other sites More sharing options...
dfowler Posted February 13, 2008 Author Share Posted February 13, 2008 Ok, I've done a little research and it seems that CURL might do what I am trying. However, I have no experience with it. Any ideas? Link to comment https://forums.phpfreaks.com/topic/90964-download-xml-report/#findComment-466230 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.