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. Link to comment https://forums.phpfreaks.com/topic/80324-passing-email-variable/ 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 Link to comment https://forums.phpfreaks.com/topic/80324-passing-email-variable/#findComment-407099 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? Link to comment https://forums.phpfreaks.com/topic/80324-passing-email-variable/#findComment-407125 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. Link to comment https://forums.phpfreaks.com/topic/80324-passing-email-variable/#findComment-407127 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> Link to comment https://forums.phpfreaks.com/topic/80324-passing-email-variable/#findComment-407167 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.