Purpose of code is to act as a redirect to a particular product id based on radio buttons and checkboxes. "paymodal" grabs a var from a radio button and "txtOpt1" and "txtOpt2" grab a var from a checkbox. The var is then inserted into the PHP code and sent to a matching redirect URL.
The problem is that the code does not work when the "txtOpt2" checkbox is selected and sends the var to this script, it just turns up a blank page rather than any redirect, and not sure why.
Thanks for any help.
<?php
$payclass=${"payclass"};
$paymodal=${"paymodal"};
// ---------------------------------------------
if ($payclass=="Credit Card")
{
switch ($paymodal)
{
case "lifetime":
$payVal = 1;
break;
case "2yr":
$payVal = 4;
break;
case "1yr":
$payVal = 9;
break;
default:
$payVal = 13;
break;
}
if ($_POST['txtOpt1'] == "ON" && $_POST['txtOpt2'] == "ON")
{
$payVal = $payVal + 1;
}
else
{
if ($_POST['txtOpt1'] == "ON")
{
$payVal = $payVal + 2;
}
else
{
$payVal = $payVal + 3;
}
header("Location: http://$payVal.url/?detail=Product&email={$_POST['email']}&name={$_POST['name']}");
}
}
?>