tqla Posted March 25, 2009 Share Posted March 25, 2009 I have a form that submits to a URL similar to this: www. sub1.website.com/reg.php This works fine. But I'd also like to send the variable information to www. sub2.website.com/reg.php I'm not sure that a form can do this on its own so I was thinking of creating an interim script that will do it. Does anybody know how to take all variables from a form and submit them to multiple locations for processing? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/151002-solved-need-to-submit-page-to-more-than-one-action/ Share on other sites More sharing options...
sKunKbad Posted March 25, 2009 Share Posted March 25, 2009 with cURL you can submit to as many as you like. Seach for it. Quote Link to comment https://forums.phpfreaks.com/topic/151002-solved-need-to-submit-page-to-more-than-one-action/#findComment-793309 Share on other sites More sharing options...
tqla Posted March 25, 2009 Author Share Posted March 25, 2009 I want it to be done with just PHP. Anybody? Quote Link to comment https://forums.phpfreaks.com/topic/151002-solved-need-to-submit-page-to-more-than-one-action/#findComment-793320 Share on other sites More sharing options...
tqla Posted March 25, 2009 Author Share Posted March 25, 2009 bump Quote Link to comment https://forums.phpfreaks.com/topic/151002-solved-need-to-submit-page-to-more-than-one-action/#findComment-793345 Share on other sites More sharing options...
sKunKbad Posted March 25, 2009 Share Posted March 25, 2009 cURL is part of php. http://www.php.net/manual/en/book.curl.php Quote Link to comment https://forums.phpfreaks.com/topic/151002-solved-need-to-submit-page-to-more-than-one-action/#findComment-793346 Share on other sites More sharing options...
thewooleymammoth Posted March 25, 2009 Share Posted March 25, 2009 isert the data into a database both can read so only one needs to process and both can read, or you could use a meta tag refresh and have the page process then send the redirect the user to the other page (via the meta refresh tag) and $_GET info for both. the second method is not secure btw Quote Link to comment https://forums.phpfreaks.com/topic/151002-solved-need-to-submit-page-to-more-than-one-action/#findComment-793347 Share on other sites More sharing options...
tqla Posted March 25, 2009 Author Share Posted March 25, 2009 Thanks Wooly, I'm considering your idea. but I don't think that will workin this case because I need to use an existing database. Skunkbad, your reply is not really in the spirit of this board. Can you give me an example? You might as well have said, "PHP can do it, look it up." Quote Link to comment https://forums.phpfreaks.com/topic/151002-solved-need-to-submit-page-to-more-than-one-action/#findComment-793349 Share on other sites More sharing options...
thewooleymammoth Posted March 25, 2009 Share Posted March 25, 2009 Thanks Wooly, I'm considering your idea. but I don't think that will workin this case because I need to use an existing database. Skunkbad, your reply is not really in the spirit of this board. Can you give me an example? You might as well have said, "PHP can do it, look it up." ive got another way have page one write the info to a file, and have the other site use file_get_content('url.to.first.site.file') and set them both to check the others files periodically Quote Link to comment https://forums.phpfreaks.com/topic/151002-solved-need-to-submit-page-to-more-than-one-action/#findComment-793353 Share on other sites More sharing options...
thewooleymammoth Posted March 25, 2009 Share Posted March 25, 2009 also you could backup all the info on the database and upload it to one they could both access Quote Link to comment https://forums.phpfreaks.com/topic/151002-solved-need-to-submit-page-to-more-than-one-action/#findComment-793354 Share on other sites More sharing options...
sKunKbad Posted March 25, 2009 Share Posted March 25, 2009 I'm sorry, just not feeling well tonight, and can't type much. Here is a tutorial on cURL post basics: http://davidwalsh.name/execute-http-post-php-curl and more tutorials: http://code.techinterviews.com/http-post-request-with-php-curl/33 http://phpsense.com/php/php-curl-functions.html http://www.toknowmore.net/e/1/php/how-to-post-data-without-forms-in-php.php Quote Link to comment https://forums.phpfreaks.com/topic/151002-solved-need-to-submit-page-to-more-than-one-action/#findComment-793363 Share on other sites More sharing options...
tqla Posted March 25, 2009 Author Share Posted March 25, 2009 Thanks everybody. I gotta lot of good advice here to get me going. Skunkbad, I learned a lot about Curl tonight. That last link you gave looks like a good solution too! Quote Link to comment https://forums.phpfreaks.com/topic/151002-solved-need-to-submit-page-to-more-than-one-action/#findComment-793376 Share on other sites More sharing options...
sKunKbad Posted March 26, 2009 Share Posted March 26, 2009 Thanks everybody. I gotta lot of good advice here to get me going. Skunkbad, I learned a lot about Curl tonight. That last link you gave looks like a good solution too! I think you will find yourself using cURL a lot now that you know it exists. I use it all the time. Quote Link to comment https://forums.phpfreaks.com/topic/151002-solved-need-to-submit-page-to-more-than-one-action/#findComment-794190 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.