frizzo Posted June 8, 2008 Share Posted June 8, 2008 Hi, can't seem to get this payment script to work, can someone please point out any spotted errors within the code? Thanks. <?php $paymodal=${"paymodal"}; $btn_cc=${"btn_cc"}; // --------------------------------------------- if ($btn_cc=="Credit Card") { if ($paymodal=="lifetime") { if ($_POST["txtOpt1"]=="ON") { if ($_POST["txtOpt2"]=="ON") { // -------------------------------------------- $54.85 header("Location: http://25.URL/?detail=&email=" . $_POST["email"]); } else { // -------------------------------------------- $44.90 header("Location: http://24.URL/?detail=&email=" . $_POST["email"]); } } else { if ($_POST["txtOpt2"]=="ON") { // -------------------------------------------- header("Location: http://24.URL/?detail=&email=" . $_POST["email"]); } else { // -------------------------------------------- $34.95 header("Location: http://23.URL/?detail=&email=" . $_POST["email"]); } } } else if ($paymodal=="2yr") { if ($_POST["txtOpt1"]=="ON") { if ($_POST["txtOpt2"]=="ON") { // -------------------------------------------- $49.78 header("Location: http://28.URL/?detail=&email=" . $_POST["email"]); } else { // -------------------------------------------- $39.83 header("Location: http://27.URL/?detail=&email=" . $_POST["email"]); } } else { if ($_POST["txtOpt2"]=="ON") { // -------------------------------------------- header("Location: http://27.URL/?detail=&email=" . $_POST["email"]); } else { // -------------------------------------------- $29.88 header("Location: http://26.URL/?detail=&email=" . $_POST["email"]); } } } else if ($paymodal=="1yr") { if ($_POST["txtOpt1"]=="ON") { if ($_POST["txtOpt2"]=="ON") { // -------------------------------------------- $39.85 header("Location: http://31.URL/?detail=&detail=&email=" . $_POST["email"]); } else { // -------------------------------------------- $29.90 header("Location: http://30.URL/?detail=&email=" . $_POST["email"]); } } else { if ($_POST["txtOpt2"]=="ON") { // -------------------------------------------- header("Location: http://30.URL/?detail=&email=" . $_POST["email"]); } else { // -------------------------------------------- $19.95 header("Location: http://29.URL/?detail=&email=" . $_POST["email"]); } } } else { header("Location: http://13.URL/?detail=&email=" . $_POST["email"]); } } ?> <form name="paymethod" action="<? echo $_SERVER["PHP_SELF"];?>" method="post"></strong> Quote Link to comment https://forums.phpfreaks.com/topic/109315-this-code-wont-run/ Share on other sites More sharing options...
pocobueno1388 Posted June 8, 2008 Share Posted June 8, 2008 What about it doesn't work? Quote Link to comment https://forums.phpfreaks.com/topic/109315-this-code-wont-run/#findComment-560724 Share on other sites More sharing options...
frizzo Posted June 8, 2008 Author Share Posted June 8, 2008 When I pass the variables to this script, it returns a blank page. Quote Link to comment https://forums.phpfreaks.com/topic/109315-this-code-wont-run/#findComment-560731 Share on other sites More sharing options...
pocobueno1388 Posted June 8, 2008 Share Posted June 8, 2008 Can you explain the first two lines? I'm not exactly sure what your trying to accomplish there. $paymodal=${"paymodal"}; $btn_cc=${"btn_cc"}; Quote Link to comment https://forums.phpfreaks.com/topic/109315-this-code-wont-run/#findComment-560734 Share on other sites More sharing options...
frizzo Posted June 8, 2008 Author Share Posted June 8, 2008 Ok, "paymodal" is to catch a radio button variable from a previous page which determines the price of an item. "btn_cc" is the id of the submit button on that page. The purpose of the script is to grab the "paymodal" and redirect to different payment links according to which variable is passed to this script. Quote Link to comment https://forums.phpfreaks.com/topic/109315-this-code-wont-run/#findComment-560745 Share on other sites More sharing options...
pocobueno1388 Posted June 8, 2008 Share Posted June 8, 2008 The way you would get post data is like this $paymodal = $_POST['paymodal']; $btn_cc = $_POST['btn_cc']; If that doesn't work, try echoing them out to see if they have a value. Quote Link to comment https://forums.phpfreaks.com/topic/109315-this-code-wont-run/#findComment-560747 Share on other sites More sharing options...
frizzo Posted June 8, 2008 Author Share Posted June 8, 2008 Yeah even with adding the echo it still posts a blank page. I wonder if there is an easier way to create a code to function the same? Quote Link to comment https://forums.phpfreaks.com/topic/109315-this-code-wont-run/#findComment-560763 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.