View Full Version : php question Not related to AMS
ianhull
06-07-2005, 03:40 AM
Hi all,
I am just beginning with php mysql and I am wondering if anyone knows a way to submit a form to 2 different formproccessors.php on different servers.
I have the same web based application running on diferent servers with a different purpose but if a customer registers for one site I would like them to also be registered for my other site without having to submit the information again.
anyone got any ideas on how to achieve this?
or any links to to a data feed script?
Thanks
Corey
06-07-2005, 03:54 AM
Hi. Sure, just use two separate HTTP.Submit() actions... :yes
ianhull
06-07-2005, 04:08 AM
Thanks Corey,
Would I place a new form method tag underneath the first one?
Do you have a litttle sample?
Thanks
Corey
06-07-2005, 04:26 AM
I think I might be mistaking this task. OK if I'm re-reading right, you have a web form on the net, and you want to send the same set of values to two different processing scripts. It sounds like more of a planning issue but anyhow one easy way is to use PHP "location" to forward the results from script one to script two. I can't post a working example on our server but the gist is:
1. Web form submits data to "process.php" on server 1.
2. Script on server one processes the data, then concatenates the variables into a string like this:
$myVars = "?var1=123532&var2=John+Smith&var3=Microsoft+XP";
3. And forwards them to script two like this:
header("Location: http://www.yoursite.com/scripttwo.php".$myVars);
4. And then script two processed the data and returns to the form, i.e.
header("Location: http://www.firstsite.com/theform.php?msg=success");
5. Or you could even use Javascript, i.e. return to a page with:
<body onload="document.siteForm.submit()">
and for your form:
<form action="<? print $site_registered_to; ?>" name="siteForm" method="POST">
<input type="hidden" name="username" value="<? print $username; ?>">
<input type="hidden" name="password" value="<? print $password; ?>">
</form>
Etc... Neither is secure. Anyhow it's some ideas to get your started... :yes :)
ianhull
06-07-2005, 07:23 AM
Excellent Corey,
Thanks, I'm sure I can customize this for my needs.
Thanks again :yes
vBulletin® v3.7.3, Copyright ©2000-2009, Jelsoft Enterprises Ltd.