Jump to content

This code won't run


frizzo

Recommended Posts

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>

Link to comment
https://forums.phpfreaks.com/topic/109315-this-code-wont-run/
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/109315-this-code-wont-run/#findComment-560745
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.