Hello, I saw somewhere that this could be possible to do: having one form and two actions. I'm a newbie to this, so i would need some help. I have a vbulletin forum. When someone registers at the forum, i have this form code: <form action="register.php" name="register" method="post" onsubmit="return verify_passwords(password, passwordconfirm);"> <input type="hidden" name="s" value="$session[sessionhash]" /> <input type="hidden" name="do" value="addmember" /> <input type="hidden" name="url" value="$url" /> <input type="hidden" name="agree" value="$agree" /> <input type="hidden" name="password_md5" /> <input type="hidden" name="passwordconfirm_md5" /> (and more fields...) Code (markup): And i also want to integrate another action like this: (this is for an affiliation program) <form method="post" action="http://my.url.com/register.html"> <input type="hidden" name="Affiliate" value="1050"> <input type="text" name="Email"> <input type="submit" name="Submit" value="Register"> </form> Code (markup): What i want is to use the email given at the registration, to send it also to the affiliation program... How can i do this? Thank you for your help
you have to use javascript function with forms onSubmit() function. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled</title> <script type="text/javascript"> <!-- function doubleSubmit(f) { // submit to action in form f.submit(); // set second action and submit f.target="_blank"; f.action="formmail2.php"; f.submit(); return false; } //--> </script> </head> <body> <form method="post" action="formmail.php" onsubmit="doubleSubmit(this); return false;"> <input type="text" name="myTextBox"><br> <textarea name="myTextArea"></textarea> <input type="submit" value="Double Submit"> </body> </html> Code (markup):
If you are using vBulletin, have you tried just adding more profile fields ? Not sure if it'll work how you want.
profile fields don't work for this... i really need is: when user clicks on "register" button, it should submit the email also to the affiliate program, which has this code: <form method="post" action="http://my.url.com/register.html"> <input type="hidden" name="Affiliate" value="1050"> <input type="text" name="Email"> <input type="submit" name="Submit" value="Register"> </form> it shouldn't be difficult to do, but i'm really newbie on this :S
Best thing to do is use cURL on your server so that when the client submits to your script, your script submits the details to the second script. That way, the original user doesn't even know about the second form.