frizzo Posted December 5, 2007 Share Posted December 5, 2007 I am trying to pass an email variable from a signup form to a second page, before finally posting the output to an order form. The form will look like this: <html> <head> <title>Form</title> </head> <body> <form action="signup2.php" method="post" target="_self"> email: <input name="email" id="email" type="text"><br /> <input type="submit"> </form> </body> </html> How can I capture the email address from this form and post the output into signup2.php so it can be inserted into my redirect URL? Redirect URL: header("Location: http://somesite.com/?email=" . $_POST["email"]); Thanks for any help. Quote Link to comment Share on other sites More sharing options...
revraz Posted December 5, 2007 Share Posted December 5, 2007 If your action="signup2.php" then there is no reason to use the email in the URL since you can just $_POST it from inside of signup2.php Quote Link to comment Share on other sites More sharing options...
frizzo Posted December 5, 2007 Author Share Posted December 5, 2007 Perhaps I am missing a piece of code? How would I use $_POST inside of "signup2.php" in order to POST the variable into the header redirects? Quote Link to comment Share on other sites More sharing options...
revraz Posted December 5, 2007 Share Posted December 5, 2007 Maybe I misunderstood what you were trying to do. If you have a Input Form on a page, there is no reason why you couldn't post the info like in your first post into a new URL like that. Just whatever script is set in your action= would be the one doing the header. Quote Link to comment Share on other sites More sharing options...
frizzo Posted December 5, 2007 Author Share Posted December 5, 2007 Here is the raw PHP code of signup2.php There is a second form submission on "signup2.php" that points to a particular header redirect. I don't understand how to get the email variable from a text box on the form that posted to "signup2.php" into the header redirects as show in the code below. <?php $paytype=${"button"}; $payselect=${"payselect"}; // --------------------------------------------- if ($paytype=="Pay Now") { if ($payselect=="lifetime") { if ($_POST["OPTIN"]=="ON") { if ($_POST["OPTIN1"]=="ON") { // -------------------------------------------- header("Location: http://1.publisher.pay.clickbank.net/?email=" . $_POST["email"]); } else { // -------------------------------------------- header("Location: http://2.publisher.pay.clickbank.net/?email=" . $_POST["email"]); } } else { if ($_POST["OPTIN1"]=="ON") { // -------------------------------------------- header("Location: http://3.publisher.pay.clickbank.net/?email=" . $_POST["email"]); } else { // -------------------------------------------- header("Location: http://4.publisher.pay.clickbank.net/?email=" . $_POST["email"]); } } } else if ($payselect=="2yr") { if ($_POST["OPTIN"]=="ON") { if ($_POST["OPTIN1"]=="ON") { // -------------------------------------------- header("Location: http://5.publisher.pay.clickbank.net/?email=" . $_POST["email"]); } else { // -------------------------------------------- header("Location: http://6.publisher.pay.clickbank.net/?email=" . $_POST["email"]); } } else { if ($_POST["OPTIN1"]=="ON") { // -------------------------------------------- header("Location: http://7.publisher.pay.clickbank.net/?email=" . $_POST["email"]); } else { // -------------------------------------------- header("Location: http://8.publisher.pay.clickbank.net/?email=" . $_POST["email"]); } } } else if ($payselect=="1yr") { if ($_POST["OPTIN"]=="ON") { if ($_POST["OPTIN1"]=="ON") { // -------------------------------------------- header("Location: http://9.publisher.pay.clickbank.net/?email=" . $_POST["email"]); } else { // -------------------------------------------- header("Location: http://10.publisher.pay.clickbank.net/?email=" . $_POST["email"]); } } else { if ($_POST["OPTIN1"]=="ON") { // -------------------------------------------- header("Location: http://11.publisher.pay.clickbank.net/?email=" . $_POST["email"]); } else { // -------------------------------------------- header("Location: http://12.publisher.pay.clickbank.net/?email=" . $_POST["email"]); } } } else { header("Location: http://13.publisher.pay.clickbank.net/?email=" . $_POST["email"]); } } ?> <form name="paymethod" action="<? echo $_SERVER["PHP_SELF"];?>" method="post"></strong> Quote Link to comment 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.