Jump to content

Trouble with my PHP Code


jslatt

Recommended Posts

Here is the code.  Most of it is stuff I got from a tutorial and then altered for my own needs.  I don't receive any errors.  I just get a blank page and nothing happens.  What should I do?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 TRANSITIONAL//EN">
<html>

<head>
	<title></title>
</head>
<body>

<?php
//uncomment for debugging
//print_r($_POST);

//most sites have magic quotes on
//but if they do not, this code simulates magic quotes
if( !get_magic_quotes_gpc() )
{
    if( is_array($_POST) )
        $_POST = array_map('addslashes', $_POST);
}


//make sure there is data in the name and email fields
if( empty($_POST["FirstName"]) )
{
    $error["firstname"] = "First Name is required.";
    $FirstName = "";
}
else
    $FirstName = $_POST["FirstName"];

if( empty($_POST["LastName"]) )
{
    $error["lastname"] = "Last Name is required.";
    $LastName = "";
}
else
    $LastName = $_POST["LastName"];

if( empty($_POST["StreetAddress1"]) )
{
    $error["streetaddress1"] = "Street Address is required.";
    $StreetAddress1 = "";
}
else
    $StreetAddress1 = $_POST["StreetAddress1"];

if( empty($_POST["StreetAddress2"]) )
{
    $StreetAddress2 = "";
}
else
    $StreetAddress2 = $_POST["StreetAddress2"];

if( empty($_POST["City"]) )
{
    $error["city"] = "City is required.";
    $City = "";
}
else
    $City = $_POST["City"];

if( empty($_POST["State"]) )
{
    $error["state"] = "State is required.";
    $State = "";
}
else
    $State = $_POST["State"];

if( empty($_POST["Zip"]) )
{
    $error["zip"] = "Zip is required.";
    $Zip = "";
}
else
    $Zip = $_POST["Zip"];

if( empty($_POST["Email"]) )
{
    $error["email"] = "Email is required.";
    $Email = "";
}
else
    $Email = $_POST["Email"];

if( empty($_POST["Phone"]) )
{
    $error["phone"] = "Phone is required.";
    $Phone = "";
}
else
    $Phone = $_POST["Phone"];

if( empty($_POST["CreditCardNumber"]) )
{
    $error["creditcardnumber"] = "Credit Card Number is required.";
    $CreditCardNumber = "";
}
else
    $CreditCardNumber = $_POST["CreditCardNumber"];

if( empty($_POST["ExpirationMonth"]) )
{
    $error["expirationmonth"] = "Expiration Month is required.";
    $ExpirationMonth = "";
}
else
    $ExpirationMonth = $_POST["ExpirationMonth"];

if( empty($_POST["ExpirationYear"]) )
{
    $error["expirationyear"] = "Expiration Year is required.";
    $ExpirationYear = "";
}
else
    $ExpirationYear = $_POST["ExpirationYear"];


  
//check to make sure the qty fields are whole numbers
//but only check if there was data entered
if( !empty($_POST["Show1REG"]) )
{
    if( is_numeric($_POST["Show1REG"]) && ( intval($_POST["Show1REG"]) == floatval($_POST["Show1REG"]) ) )
    {
        //we have a whole number
    }
    else
        $error["Show1REG"] = "Please enter a whole number when ordering tickets.";
}

if( !empty($_POST["Show1SRCIT"]) )
{
    if( is_numeric($_POST["Show1SRCIT"]) && ( intval($_POST["Show1SRCIT"]) == floatval($_POST["Show1SRCIT"]) ) )
    {
        //we have a whole number
    }
    else
        $error["Show1SRCIT"] = "Please enter a whole number when ordering tickets.";
}

if( !empty($_POST["Show1TEEN"]) )
{
    if( is_numeric($_POST["Show1TEEN"]) && ( intval($_POST["Show1TEEN"]) == floatval($_POST["Show1TEEN"]) ) )
    {
        //we have a whole number
    }
    else
        $error["Show1TEEN"] = "Please enter a whole number when ordering tickets.";
}

if( !empty($_POST["Show1CHILD"]) )
{
    if( is_numeric($_POST["Show1CHILD"]) && ( intval($_POST["Show1CHILD"]) == floatval($_POST["Show1CHILD"]) ) )
    {
        //we have a whole number
    }
    else
        $error["Show1CHILD"] = "Please enter a whole number when ordering tickets.";
}

if( !empty($_POST["Show2REG"]) )
{
    if( is_numeric($_POST["Show2REG"]) && ( intval($_POST["Show2REG"]) == floatval($_POST["Show2REG"]) ) )
    {
        //we have a whole number
    }
    else
        $error["Show2REG"] = "Please enter a whole number when ordering tickets.";
}

if( !empty($_POST["Show2SRCIT"]) )
{
    if( is_numeric($_POST["Show2SRCIT"]) && ( intval($_POST["Show2SRCIT"]) == floatval($_POST["Show2SRCIT"]) ) )
    {
        //we have a whole number
    }
    else
        $error["Show2SRCIT"] = "Please enter a whole number when ordering tickets.";
}

if( !empty($_POST["Show2TEEN"]) )
{
    if( is_numeric($_POST["Show2TEEN"]) && ( intval($_POST["Show2TEEN"]) == floatval($_POST["Show2TEEN"]) ) )
    {
        //we have a whole number
    }
    else
        $error["Show2TEEN"] = "Please enter a whole number when ordering tickets.";
}

if( !empty($_POST["Show2CHILD"]) )
{
    if( is_numeric($_POST["Show2CHILD"]) && ( intval($_POST["Show2CHILD"]) == floatval($_POST["Show2CHILD"]) ) )
    {
        //we have a whole number
    }
    else
        $error["Show2CHILD"] = "Please enter a whole number when ordering tickets.";
}

if( !empty($_POST["Show3REG"]) )
{
    if( is_numeric($_POST["Show3REG"]) && ( intval($_POST["Show3REG"]) == floatval($_POST["Show3REG"]) ) )
    {
        //we have a whole number
    }
    else
        $error["Show3REG"] = "Please enter a whole number when ordering tickets.";
}

if( !empty($_POST["Show3SRCIT"]) )
{
    if( is_numeric($_POST["Show3SRCIT"]) && ( intval($_POST["Show3SRCIT"]) == floatval($_POST["Show3SRCIT"]) ) )
    {
        //we have a whole number
    }
    else
        $error["Show3SRCIT"] = "Please enter a whole number when ordering tickets.";
}

if( !empty($_POST["Show3TEEN"]) )
{
    if( is_numeric($_POST["Show3TEEN"]) && ( intval($_POST["Show3TEEN"]) == floatval($_POST["Show3TEEN"]) ) )
    {
        //we have a whole number
    }
    else
        $error["Show3TEEN"] = "Please enter a whole number when ordering tickets.";
}

if( !empty($_POST["Show3CHILD"]) )
{
    if( is_numeric($_POST["Show3CHILD"]) && ( intval($_POST["Show3CHILD"]) == floatval($_POST["Show3CHILD"]) ) )
    {
        //we have a whole number
    }
    else
        $error["Show3CHILD"] = "Please enter a whole number when ordering tickets.";
}

if( !empty($_POST["Show4REG"]) )
{
    if( is_numeric($_POST["Show4REG"]) && ( intval($_POST["Show4REG"]) == floatval($_POST["Show4REG"]) ) )
    {
        //we have a whole number
    }
    else
        $error["Show4REG"] = "Please enter a whole number when ordering tickets.";
}

if( !empty($_POST["Show4SRCIT"]) )
{
    if( is_numeric($_POST["Show4SRCIT"]) && ( intval($_POST["Show4SRCIT"]) == floatval($_POST["Show4SRCIT"]) ) )
    {
        //we have a whole number
    }
    else
        $error["Show4SRCIT"] = "Please enter a whole number when ordering tickets.";
}

if( !empty($_POST["Show4TEEN"]) )
{
    if( is_numeric($_POST["Show4TEEN"]) && ( intval($_POST["Show4TEEN"]) == floatval($_POST["Show4TEEN"]) ) )
    {
        //we have a whole number
    }
    else
        $error["Show4TEEN"] = "Please enter a whole number when ordering tickets.";
}

if( !empty($_POST["Show4CHILD"]) )
{
    if( is_numeric($_POST["Show4CHILD"]) && ( intval($_POST["Show4CHILD"]) == floatval($_POST["Show4CHILD"]) ) )
    {
        //we have a whole number
    }
    else
        $error["Show4CHILD"] = "Please enter a whole number when ordering tickets.";
}

if( !empty($_POST["Show5REG"]) )
{
    if( is_numeric($_POST["Show5REG"]) && ( intval($_POST["Show5REG"]) == floatval($_POST["Show5REG"]) ) )
    {
        //we have a whole number
    }
    else
        $error["Show5REG"] = "Please enter a whole number when ordering tickets.";
}

if( !empty($_POST["Show5SRCIT"]) )
{
    if( is_numeric($_POST["Show5SRCIT"]) && ( intval($_POST["Show5SRCIT"]) == floatval($_POST["Show5SRCIT"]) ) )
    {
        //we have a whole number
    }
    else
        $error["Show5SRCIT"] = "Please enter a whole number when ordering tickets.";
}

if( !empty($_POST["Show5TEEN"]) )
{
    if( is_numeric($_POST["Show5TEEN"]) && ( intval($_POST["Show5TEEN"]) == floatval($_POST["Show5TEEN"]) ) )
    {
        //we have a whole number
    }
    else
        $error["Show5TEEN"] = "Please enter a whole number when ordering tickets.";
}

if( !empty($_POST["Show5CHILD"]) )
{
    if( is_numeric($_POST["Show5CHILD"]) && ( intval($_POST["Show5CHILD"]) == floatval($_POST["Show5CHILD"]) ) )
    {
        //we have a whole number
    }
    else
        $error["Show5CHILD"] = "Please enter a whole number when ordering tickets.";
}

if( !empty($_POST["Show6REG"]) )
{
    if( is_numeric($_POST["Show6REG"]) && ( intval($_POST["Show6REG"]) == floatval($_POST["Show6REG"]) ) )
    {
        //we have a whole number
    }
    else
        $error["Show6REG"] = "Please enter a whole number when ordering tickets.";
}

if( !empty($_POST["Show6SRCIT"]) )
{
    if( is_numeric($_POST["Show6SRCIT"]) && ( intval($_POST["Show6SRCIT"]) == floatval($_POST["Show6SRCIT"]) ) )
    {
        //we have a whole number
    }
    else
        $error["Show6SRCIT"] = "Please enter a whole number when ordering tickets.";
}

if( !empty($_POST["Show6TEEN"]) )
{
    if( is_numeric($_POST["Show6TEEN"]) && ( intval($_POST["Show6TEEN"]) == floatval($_POST["Show6TEEN"]) ) )
    {
        //we have a whole number
    }
    else
        $error["Show6TEEN"] = "Please enter a whole number when ordering tickets.";
}

if( !empty($_POST["Show6CHILD"]) )
{
    if( is_numeric($_POST["Show6CHILD"]) && ( intval($_POST["Show6CHILD"]) == floatval($_POST["Show6CHILD"]) ) )
    {
        //we have a whole number
    }
    else
        $error["Show6CHILD"] = "Please enter a whole number when ordering tickets.";
}

if( !empty($_POST["Show7REG"]) )
{
    if( is_numeric($_POST["Show7REG"]) && ( intval($_POST["Show7REG"]) == floatval($_POST["Show7REG"]) ) )
    {
        //we have a whole number
    }
    else
        $error["Show7REG"] = "Please enter a whole number when ordering tickets.";
}

if( !empty($_POST["Show7SRCIT"]) )
{
    if( is_numeric($_POST["Show7SRCIT"]) && ( intval($_POST["Show7SRCIT"]) == floatval($_POST["Show7SRCIT"]) ) )
    {
        //we have a whole number
    }
    else
        $error["Show7SRCIT"] = "Please enter a whole number when ordering tickets.";
}

if( !empty($_POST["Show7TEEN"]) )
{
    if( is_numeric($_POST["Show7TEEN"]) && ( intval($_POST["Show7TEEN"]) == floatval($_POST["Show7TEEN"]) ) )
    {
        //we have a whole number
    }
    else
        $error["Show7TEEN"] = "Please enter a whole number when ordering tickets.";
}

if( !empty($_POST["Show7CHILD"]) )
{
    if( is_numeric($_POST["Show7CHILD"]) && ( intval($_POST["Show7CHILD"]) == floatval($_POST["Show7CHILD"]) ) )
    {
        //we have a whole number
    }
    else
        $error["Show7CHILD"] = "Please enter a whole number when ordering tickets.";
}

if( !empty($_POST["Show8REG"]) )
{
    if( is_numeric($_POST["Show8REG"]) && ( intval($_POST["Show8REG"]) == floatval($_POST["Show8REG"]) ) )
    {
        //we have a whole number
    }
    else
        $error["Show8REG"] = "Please enter a whole number when ordering tickets.";
}

if( !empty($_POST["Show8SRCIT"]) )
{
    if( is_numeric($_POST["Show8SRCIT"]) && ( intval($_POST["Show8SRCIT"]) == floatval($_POST["Show8SRCIT"]) ) )
    {
        //we have a whole number
    }
    else
        $error["Show8SRCIT"] = "Please enter a whole number when ordering tickets.";
}

if( !empty($_POST["Show8TEEN"]) )
{
    if( is_numeric($_POST["Show8TEEN"]) && ( intval($_POST["Show8TEEN"]) == floatval($_POST["Show8TEEN"]) ) )
    {
        //we have a whole number
    }
    else
        $error["Show8TEEN"] = "Please enter a whole number when ordering tickets.";
}

if( !empty($_POST["Show8CHILD"]) )
{
    if( is_numeric($_POST["Show8CHILD"]) && ( intval($_POST["Show8CHILD"]) == floatval($_POST["Show8CHILD"]) ) )
    {
        //we have a whole number
    }
    else
        $error["Show8CHILD"] = "Please enter a whole number when ordering tickets.";
}

if( !empty($_POST["PKG1REG"]) )
{
    if( is_numeric($_POST["PKG1REG"]) && ( intval($_POST["PKG1REG"]) == floatval($_POST["PKG1REG"]) ) )
    {
        //we have a whole number
    }
    else
        $error["PKG1REG"] = "Please enter a whole number when ordering tickets.";
}

if( !empty($_POST["PKG1SRCIT"]) )
{
    if( is_numeric($_POST["PKG1SRCIT"]) && ( intval($_POST["PKG1SRCIT"]) == floatval($_POST["PKG1SRCIT"]) ) )
    {
        //we have a whole number
    }
    else
        $error["PKG1SRCIT"] = "Please enter a whole number when ordering tickets.";
}

if( !empty($_POST["PKG1TEEN"]) )
{
    if( is_numeric($_POST["PKG1TEEN"]) && ( intval($_POST["PKG1TEEN"]) == floatval($_POST["PKG1TEEN"]) ) )
    {
        //we have a whole number
    }
    else
        $error["PKG1TEEN"] = "Please enter a whole number when ordering tickets.";
}

if( !empty($_POST["PKG1CHILD"]) )
{
    if( is_numeric($_POST["PKG1CHILD"]) && ( intval($_POST["PKG1CHILD"]) == floatval($_POST["PKG1CHILD"]) ) )
    {
        //we have a whole number
    }
    else
        $error["PKG1CHILD"] = "Please enter a whole number when ordering tickets.";
}


if( !empty($_POST["PKG2REG"]) )
{
    if( is_numeric($_POST["PKG2REG"]) && ( intval($_POST["PKG2REG"]) == floatval($_POST["PKG2REG"]) ) )
    {
        //we have a whole number
    }
    else
        $error["PKG2REG"] = "Please enter a whole number when ordering tickets.";
}

if( !empty($_POST["PKG2SRCIT"]) )
{
    if( is_numeric($_POST["PKG2SRCIT"]) && ( intval($_POST["PKG2SRCIT"]) == floatval($_POST["PKG2SRCIT"]) ) )
    {
        //we have a whole number
    }
    else
        $error["PKG2SRCIT"] = "Please enter a whole number when ordering tickets.";
}

if( !empty($_POST["PKG2TEEN"]) )
{
    if( is_numeric($_POST["PKG2TEEN"]) && ( intval($_POST["PKG2TEEN"]) == floatval($_POST["PKG2TEEN"]) ) )
    {
        //we have a whole number
    }
    else
        $error["PKG2TEEN"] = "Please enter a whole number when ordering tickets.";
}

if( !empty($_POST["PKG2CHILD"]) )
{
    if( is_numeric($_POST["PKG2CHILD"]) && ( intval($_POST["PKG2CHILD"]) == floatval($_POST["PKG2CHILD"]) ) )
    {
        //we have a whole number
    }
    else
        $error["PKG2CHILD"] = "Please enter a whole number when ordering tickets.";
}

//we need to check to see if the individual ticket dates are entered
//if( empty($_POST["Show1DATE"]))
//	$error["no_date"] = "Please enter a date for your individual tickets.";

//if( empty($_POST["Show2DATE"]))
//	$error["no_date"] = "Please enter a date for your individual tickets.";

//if( empty($_POST["Show3DATE"]))
//	$error["no_date"] = "Please enter a date for your individual tickets.";

//if( empty($_POST["Show4DATE"]))
//	$error["no_date"] = "Please enter a date for your individual tickets.";

//if( empty($_POST["Show5DATE"]))
//	$error["no_date"] = "Please enter a date for your individual tickets.";

//if( empty($_POST["Show6DATE"]))
//	$error["no_date"] = "Please enter a date for your individual tickets.";

//if( empty($_POST["Show7DATE"]))
//	$error["no_date"] = "Please enter a date for your individual tickets.";

//if( empty($_POST["Show8DATE"]))
//	$error["no_date"] = "Please enter a date for your individual tickets.";


//we should have at least 1 item ordered in the form
if( empty($_POST["Show1REG"]) && empty($_POST["Show1SRCIT"]) && empty($_POST["Show1TEEN"]) && empty($_POST["Show1CHILD"]) 
&& empty($_POST["Show2REG"]) && empty($_POST["Show2SRCIT"]) && empty($_POST["Show2TEEN"]) && empty($_POST["Show2CHILD"])
&& empty($_POST["Show3REG"]) && empty($_POST["Show3SRCIT"]) && empty($_POST["Show3TEEN"]) && empty($_POST["Show3CHILD"])
&& empty($_POST["Show4REG"]) && empty($_POST["Show4SRCIT"]) && empty($_POST["Show4TEEN"]) && empty($_POST["Show4CHILD"])
&& empty($_POST["Show5REG"]) && empty($_POST["Show5SRCIT"]) && empty($_POST["Show5TEEN"]) && empty($_POST["Show5CHILD"])
&& empty($_POST["Show6REG"]) && empty($_POST["Show6SRCIT"]) && empty($_POST["Show6TEEN"]) && empty($_POST["Show6CHILD"])
&& empty($_POST["Show7REG"]) && empty($_POST["Show7SRCIT"]) && empty($_POST["Show7TEEN"]) && empty($_POST["Show7CHILD"])
&& empty($_POST["Show8REG"]) && empty($_POST["Show8SRCIT"]) && empty($_POST["Show8TEEN"]) && empty($_POST["Show8CHILD"])
&& empty($_POST["PKG1REG"]) && empty($_POST["PKG1SRCIT"]) && empty($_POST["PKG1TEEN"]) && empty($_POST["PKG1CHILD"])
&& empty($_POST["PKG2REG"]) && empty($_POST["PKG2SRCIT"]) && empty($_POST["PKG2TEEN"]) && empty($_POST["PKG2CHILD"])
&& empty($_POST["GCREG"]) && empty($_POST["GCSRCIT"]) && empty($_POST["GCTEEN"]) && empty($_POST["GCCHILD"])
&& empty($_POST["DONATION"]))
    $error["no_qty"] = "Please enter at least 1 item to order.";


if( is_array($error) )
{

    echo "An error occurred while processing your order.";
    echo "<br>\n";
    echo "Please check the following error messages carefully, then click back in your browser.";
    echo "<br>\n";

    while(list($key, $val) = each($error))
    {
        echo $val;
        echo "<br>\n";
    }

    //stop everything as we have errors and should not continue
    exit();

}

  
//we do not need the rest of the form fields as we can just calculate them from the whole numbers
if( !empty($_POST["Show1REG"]) )
{
    $Show1REG = $_POST["Show1REG"];
    $S1RT = $Show1REG * 18.00;
}
else
{
    $Show1REG = 0;
    $S1RT = 0;
}

if( !empty($_POST["Show1SRCIT"]) )
{
    $Show1SRCIT = $_POST["Show1SRCIT"];
    $S1SCT = $Show1SRCIT * 16.00;
}
else
{
    $Show1SRCIT = 0;
    $S1SCT = 0;
}

if( !empty($_POST["Show1TEEN"]) )
{
    $Show1TEEN = $_POST["Show1TEEN"];
    $S1TT = $Show1TEEN * 14.00;
}
else
{
    $Show1TEEN = 0;
    $S1TT = 0;
}

if( !empty($_POST["Show1CHILD"]) )
{
    $Show1CHILD = $_POST["Show1CHILD"];
    $S1CT = $Show1CHILD * 10.00;
}
else
{
    $Show1CHILD = 0;
    $S1CT = 0;
}

if( !empty($_POST["Show2REG"]) )
{
    $Show2REG = $_POST["Show2REG"];
    $S2RT = $Show2REG * 18.00;
}
else
{
    $Show2REG = 0;
    $S2RT = 0;
}

if( !empty($_POST["Show2SRCIT"]) )
{
    $Show2SRCIT = $_POST["Show2SRCIT"];
    $S2SCT = $Show2SRCIT * 16.00;
}
else
{
    $Show2SRCIT = 0;
    $S2SCT = 0;
}

if( !empty($_POST["Show2TEEN"]) )
{
    $Show2TEEN = $_POST["Show2TEEN"];
    $S2TT = $Show2TEEN * 14.00;
}
else
{
    $Show2TEEN = 0;
    $S2TT = 0;
}

if( !empty($_POST["Show2CHILD"]) )
{
    $Show2CHILD = $_POST["Show2CHILD"];
    $S2CT = $Show2CHILD * 10.00;
}
else
{
    $Show2CHILD = 0;
    $S2CT = 0;
}

if( !empty($_POST["Show3REG"]) )
{
    $Show3REG = $_POST["Show3REG"];
    $S3RT = $Show3REG * 18.00;
}
else
{
    $Show3REG = 0;
    $S3RT = 0;
}

if( !empty($_POST["Show3SRCIT"]) )
{
    $Show3SRCIT = $_POST["Show3SRCIT"];
    $S3SCT = $Show3SRCIT * 16.00;
}
else
{
    $Show3SRCIT = 0;
    $S3SCT = 0;
}

if( !empty($_POST["Show3TEEN"]) )
{
    $Show3TEEN = $_POST["Show3TEEN"];
    $S3TT = $Show3TEEN * 14.00;
}
else
{
    $Show3TEEN = 0;
    $S3TT = 0;
}

if( !empty($_POST["Show3CHILD"]) )
{
    $Show3CHILD = $_POST["Show3CHILD"];
    $S3CT = $Show3CHILD * 10.00;
}
else
{
    $Show3CHILD = 0;
    $S3CT = 0;
}

if( !empty($_POST["Show4REG"]) )
{
    $Show4REG = $_POST["Show4REG"];
    $S4RT = $Show4REG * 18.00;
}
else
{
    $Show4REG = 0;
    $S4RT = 0;
}

if( !empty($_POST["Show4SRCIT"]) )
{
    $Show4SRCIT = $_POST["Show4SRCIT"];
    $41SCT = $Show4SRCIT * 16.00;
}
else
{
    $Show4SRCIT = 0;
    $S4SCT = 0;
}

if( !empty($_POST["Show4TEEN"]) )
{
    $Show4TEEN = $_POST["Show4TEEN"];
    $S4TT = $Show4TEEN * 14.00;
}
else
{
    $Show4TEEN = 0;
    $S4TT = 0;
}

if( !empty($_POST["Show4CHILD"]) )
{
    $Show4CHILD = $_POST["Show4CHILD"];
    $S4CT = $Show4CHILD * 10.00;
}
else
{
    $Show4CHILD = 0;
    $S4CT = 0;
}

if( !empty($_POST["Show5REG"]) )
{
    $Show5REG = $_POST["Show5REG"];
    $S5RT = $Show5REG * 18.00;
}
else
{
    $Show5REG = 0;
    $S5RT = 0;
}

if( !empty($_POST["Show5SRCIT"]) )
{
    $Show5SRCIT = $_POST["Show5SRCIT"];
    $S5SCT = $Show5SRCIT * 16.00;
}
else
{
    $Show5SRCIT = 0;
    $S5SCT = 0;
}

if( !empty($_POST["Show5TEEN"]) )
{
    $Show5TEEN = $_POST["Show5TEEN"];
    $S5TT = $Show5TEEN * 14.00;
}
else
{
    $Show5TEEN = 0;
    $S5TT = 0;
}

if( !empty($_POST["Show5CHILD"]) )
{
    $Show5CHILD = $_POST["Show5CHILD"];
    $S5CT = $Show5CHILD * 10.00;
}
else
{
    $Show5CHILD = 0;
    $S5CT = 0;
}

if( !empty($_POST["Show6REG"]) )
{
    $Show6REG = $_POST["Show6REG"];
    $S6RT = $Show6REG * 18.00;
}
else
{
    $Show6REG = 0;
    $S6RT = 0;
}

if( !empty($_POST["Show6SRCIT"]) )
{
    $Show6SRCIT = $_POST["Show6SRCIT"];
    $S6SCT = $Show6SRCIT * 16.00;
}
else
{
    $Show6SRCIT = 0;
    $S6SCT = 0;
}

if( !empty($_POST["Show6TEEN"]) )
{
    $Show6TEEN = $_POST["Show6TEEN"];
    $S6TT = $Show6TEEN * 14.00;
}
else
{
    $Show6TEEN = 0;
    $S6TT = 0;
}

if( !empty($_POST["Show6CHILD"]) )
{
    $Show6CHILD = $_POST["Show6CHILD"];
    $S6CT = $Show6CHILD * 10.00;
}
else
{
    $Show6CHILD = 0;
    $S6CT = 0;
}

if( !empty($_POST["Show7REG"]) )
{
    $Show7REG = $_POST["Show7REG"];
    $S7RT = $Show7REG * 18.00;
}
else
{
    $Show7REG = 0;
    $S7RT = 0;
}

if( !empty($_POST["Show7SRCIT"]) )
{
    $Show7SRCIT = $_POST["Show7SRCIT"];
    $S7SCT = $Show7SRCIT * 16.00;
}
else
{
    $Show7SRCIT = 0;
    $S7SCT = 0;
}

if( !empty($_POST["Show7TEEN"]) )
{
    $Show7TEEN = $_POST["Show7TEEN"];
    $S7TT = $Show7TEEN * 14.00;
}
else
{
    $Show7TEEN = 0;
    $S7TT = 0;
}

if( !empty($_POST["Show7CHILD"]) )
{
    $Show7CHILD = $_POST["Show7CHILD"];
    $S7CT = $Show7CHILD * 10.00;
}
else
{
    $Show7CHILD = 0;
    $S7CT = 0;
}

if( !empty($_POST["Show8REG"]) )
{
    $Show8REG = $_POST["Show8REG"];
    $S8RT = $Show8REG * 18.00;
}
else
{
    $Show8REG = 0;
    $S8RT = 0;
}

if( !empty($_POST["Show8SRCIT"]) )
{
    $Show8SRCIT = $_POST["Show8SRCIT"];
    $S8SCT = $Show8SRCIT * 16.00;
}
else
{
    $Show8SRCIT = 0;
    $S8SCT = 0;
}

if( !empty($_POST["Show8TEEN"]) )
{
    $Show8TEEN = $_POST["Show8TEEN"];
    $S8TT = $Show8TEEN * 14.00;
}
else
{
    $Show8TEEN = 0;
    $S8TT = 0;
}

if( !empty($_POST["Show8CHILD"]) )
{
    $Show8CHILD = $_POST["Show8CHILD"];
    $S8CT = $Show8CHILD * 10.00;
}
else
{
    $Show8CHILD = 0;
    $S8CT = 0;
}

if( !empty($_POST["PKG1REG"]) )
{
    $PKG1REG = $_POST["PKG1REG"];
    $P1RT = $PKG1REG * 84.95;
}
else
{
    $PKG1REG = 0;
    $P1RT = 0;
}

if( !empty($_POST["PKG1SRCIT"]) )
{
    $PKG1SRCIT = $_POST["PKG1SRCIT"];
    $P1SCT = $PKG1SRCIT * 75.95;
}
else
{
    $PKG1SRCIT = 0;
    $P1SCT = 0;
}

if( !empty($_POST["PKG1TEEN"]) )
{
    $PKG1TEEN = $_POST["PKG1TEEN"];
    $P1TT = $PKG1TEEN * 66.95;
}
else
{
    $PKG1TEEN = 0;
    $P1TT = 0;
}

if( !empty($_POST["PKG1CHILD"]) )
{
    $PKG1CHILD = $_POST["PKG1CHILD"];
    $P1CT = $PKG1CHILD * 47.95;
}
else
{
    $PKG1CHILD = 0;
    $P1CT = 0;
}

if( !empty($_POST["PKG2REG"]) )
{
    $PKG2REG = $_POST["PKG2REG"];
    $P2RT = $PKG2REG * 86.95;
}
else
{
    $PKG2REG = 0;
    $P2RT = 0;
}

if( !empty($_POST["PKG2SRCIT"]) )
{
    $PKG2SRCIT = $_POST["PKG2SRCIT"];
    $P2SCT = $PKG2SRCIT * 76.95;
}
else
{
    $PKG2SRCIT = 0;
    $P2SCT = 0;
}

if( !empty($_POST["PKG2TEEN"]) )
{
    $PKG2TEEN = $_POST["PKG2TEEN"];
    $P2TT = $PKG2TEEN * 67.95;
}
else
{
    $PKG2TEEN = 0;
    $P2TT = 0;
}

if( !empty($_POST["PKG2CHILD"]) )
{
    $PKG2CHILD = $_POST["PKG2CHILD"];
    $P2CT = $PKG2CHILD * 47.95;
}
else
{
    $PKG2CHILD = 0;
    $P2CT = 0;
}

if( !empty($_POST["GCREG"]) )
{
    $GCREG = $_POST["GCREG"];
    $GRT = $GCREG * 18.00;
}
else
{
    $GCREG = 0;
    $GCRT = 0;
}

if( !empty($_POST["GCSRCIT"]) )
{
    $GCSRCIT = $_POST["GCSRCIT"];
    $GSCT = $GCSRCIT * 16.00;
}
else
{
    $GCSRCIT = 0;
    $GSCT = 0;
}

if( !empty($_POST["GCTEEN"]) )
{
    $GCTEEN = $_POST["GCTEEN"];
    $GTT = $GCTEEN * 14.00;
}
else
{
    $GCTEEN = 0;
    $GTT = 0;
}

if( !empty($_POST["GCCHILD"]) )
{
    $GCCHILD = $_POST["GCCHILD"];
    $GCT = $GCCHILD * 10.00;
}
else
{
    $GCCHILD = 0;
    $GCT = 0;
}



$Show1Total = $S1RT + $S1SCT + $S1TT + $S1CT;
$Show2Total = $S2RT + $S2SCT + $S2TT + $S2CT;
$Show3Total = $S3RT + $S3SCT + $S3TT + $S3CT;
$Show4Total = $S4RT + $S4SCT + $S4TT + $S4CT;
$Show5Total = $S5RT + $S5SCT + $S5TT + $S5CT;
$Show6Total = $S6RT + $S6SCT + $S6TT + $S6CT;
$Show7Total = $S7RT + $S7SCT + $S7TT + $S7CT;
$Show8Total = $S8RT + $S8SCT + $S8TT + $S8CT;
$PKG1Total = $P1RT + $P1SCT + $P1TT + $P1CT;
$PKG2Total = $P2RT + $P2SCT + $P2TT + $P2CT;
$GCTotal = $GRT + $GSCT + $GTT + $GCT;

$SubTotal = $Show1Total + $Show2Total + $Show3Total + $Show4Total + $Show5Total + $Show6Total + $Show7Total + $Show8Total + $PKG1Total + $PKG2Total + $GCTotal;

$AddTran = $SubTotal + 4.00;

$TaxCalc = $AddTran * 0.055

$Donation = $_POST["DONATION"];

if($State = "WI")
{
$SubTotal2 = $AddTran + $TaxCalc;
}
else
{
$SubTotal2 = $AddTran;
}

$GrandTotal = $SubTotal2 + $Donation;

$SeatPref = $_POST["SeatPref"]
$Show1Date = $_POST["Show1Date"];
$Show2Date = $_POST["Show2Date"];
$Show3Date = $_POST["Show3Date"];
$Show4Date = $_POST["Show4Date"];
$Show5Date = $_POST["Show5Date"];
$Show6Date = $_POST["Show6Date"];
$Show7Date = $_POST["Show7Date"];
$Show8Date = $_POST["Show8Date"];
$PKG1Show1Date = $_POST["PKG1Show1Date"];
$PKG1Show2Date = $_POST["PKG1Show2Date"];
$PKG1Show3Date = $_POST["PKG1Show3Date"];
$PKG1Show4Date = $_POST["PKG1Show4Date"];
$PKG1Show5Date = $_POST["PKG1Show5Date"];
$PKG1Show6Date = $_POST["PKG1Show6Date"];
$PKG1Show7Date = $_POST["PKG1Show7Date"];
$PKG2Show1Date = $_POST["PKG2Show1Date"];
$PKG2Show2Date = $_POST["PKG2Show2Date"];
$PKG2Show3Date = $_POST["PKG2Show3Date"];
$PKG2Show4Date = $_POST["PKG2Show4Date"];
$PKG2Show5Date = $_POST["PKG2Show5Date"];
$PKG2Show6Date = $_POST["PKG2Show6Date"];
$P1later = $_POST["P1later"] 
$P2later = $_POST["P2later"] 
  
//we have our data, and now build up an email message to send
$mailto = "[email protected]";
$subject = "Web Order";

$body  = "The following confirms the details of your order:\n";
$body .= "\n\n";
$body .= "Name: " . $FirstName . " " . $LastName . "\n";
$body .= "Street: " . $StreetAddress1 . "\n";
$body .= "Street: " . $StreetAddress2 . "\n";
$body .= "City, State  Zip: " . $City . ", " . $State . "  " . $Zip . "\n";
$body .= "Email: " . $Email . "\n";
$body .= "Phone: " . $Phone . "\n";
$body .= "Credit Card: " . $CreditCardNumber . "\n";
$body .= "Expiration(MM/YY): " . $ExpirationMonth . "/" . $ExpirationYear . "\n";
$body .= "\n\n";
$body .= "Seat Preference: " . $SeatPref . "\n";
$body .= "\n\n";
$body .= "Individual Tickets\n";
$body .= "Secret Garden: (" . $Show1Date . " REG " . $Show1REG . " SR CIT " . $Show1SRCIT . " TEEN " . $Show1TEEN . " CHILD " . $Show1CHILD . " Total ". $Show1Total . ")\n";
$body .= "Funny Money: (" . $Show2Date . " REG " . $Show2REG . " SR CIT " . $Show2SRCIT . " TEEN " . $Show2TEEN . " CHILD " . $Show2CHILD . " Total ". $Show2Total . ")\n";
$body .= "The Nerd: (" . $Show3Date . " REG " . $Show3REG . " SR CIT " . $Show3SRCIT . " TEEN " . $Show3TEEN . " CHILD " . $Show3CHILD . " Total ". $Show3Total . ")\n";
$body .= "Fat Pig: (" . $Show4Date . " REG " . $Show4REG . " SR CIT " . $Show4SRCIT . " TEEN " . $Show4TEEN . " CHILD " . $Show4CHILD . " Total ". $Show4Total . ")\n";
$body .= "Getting Mama Married: (" . $Show5Date . " REG " . $Show5REG . " SR CIT " . $Show5SRCIT . " TEEN " . $Show5TEEN . " CHILD " . $Show5CHILD . " Total ". $Show5Total . ")\n";
$body .= "Tuesdays with Morrie: (" . $Show6Date . " REG " . $Show6REG . " SR CIT " . $Show6SRCIT . " TEEN " . $Show6TEEN . " CHILD " . $Show6CHILD . " Total ". $Show6Total . ")\n";
$body .= "Six Dance Lessons in Six Weeks: (" . $Show7Date . " REG " . $Show7REG . " SR CIT " . $Show7SRCIT . " TEEN " . $Show7TEEN . " CHILD " . $Show7CHILD . " Total". $Show7Total . ")\n";
$body .= "Children's Theatre:  Secret Garden: (" . $Show8Date . " REG " . $Show8REG . " SR CIT " . $Show8SRCIT . " TEEN " . $Show8TEEN . " CHILD " . $Show8CHILD . " Total ". $Show8Total . ")\n";
$body .= "\n\n";

$body .= "Season Ticket: (REG " . $PKG1REG . " SR CIT " . $PKG1SRCIT . " TEEN " . $PKG1TEEN . " CHILD " . $PKG1CHILD . " Total ". $PKG1Total . ")\n";
$body .= "Season Ticket Question: (I will select at a later date? " . $P1later . ")\n";
$body .= "Season Ticket Dates: (Secret Garden " . $PKG1Show1Date . " Funny Money " . $PKG1Show2Date . " The Nerd " . $PKG1Show3Date . " Fat Pig " . $PKG1Show4Date . ")\n";
$body .= "Season Ticket Dates: (Getting Mama Married " . $PKG1Show5Date . " Tuesdays with Morrie " . $PKG1Show6Date . " Six Dance Lessons " . $PKG1Show7Date . ")\n";
$body .= "\n\n";
$body .= "Summer Coupon: (REG " . $PKG2REG . " SR CIT " . $PKG2SRCIT . " TEEN " . $PKG2TEEN . " CHILD " . $PKG2CHILD . " Total ". $PKG2Total . "\n";
$body .= "Summer Coupon Question: (I will select at a later date? " . $P2later . ")\n";
$body .= "Summer Coupon Dates: (Secret Garden " . $PKG2Show1Date . " Funny Money " . $PKG2Show2Date . " The Nerd " . $PKG2Show3Date . " Fat Pig " . $PKG2Show4Date . ")\n";
$body .= "Season Ticket Dates: (Getting Mama Married " . $PKG2Show5Date . " Tuesdays with Morrie " . $PKG2Show6Date . ")\n";
$body .= "\n\n";
$body .= "Gift Certificate: (REG " . $GCREG . " SR CIT " . $GCSRCIT . " TEEN " . $GCTEEN . " CHILD " . $GCCHILD . " Total ". $GCTotal . "\n";


$body .= "Subtotal: " . $SubTotal . "\n";
$body .= "Transaction Fee: $4.00 \n";
$body .= "Subtotal2: " . $AddTran . "\n";
$body .= "Tax: " . $TaxCalc . "\n";
$body .= "Donation: " . $Donation . "\n";
$body .= "Grand Total: " . $GrandTotal . "\n";


mail($mailto, $subject, $body);


//we should state the order was sent
echo "The following information was sent.";
echo "<br>\n";
echo "<pre>\n";
echo $body;
echo "</pre>\n";


//we can store the order in a database as well

$link = @mysql_connect('mysql', 'nlporder', 'nlporder');
if (!$link)
{
   echo "Could not connect: " . mysql_error();
}
else
{
    mysql_select_db('my_database');

    $query  = "INSERT INTO order_queue
             (  FirstName , LastName , StreetAddress1 , StreetAddress2 , City , State , Zip ,  Email ,   CreditCardNumber ,   ExpirationMonth ,
                ExpirationYear , SeatPref ,
			Show1Date , Show1REG , Show1SRCIT , Show1TEEN , Show1CHILD , Show1Total , 
			Show2Date , Show2REG , Show2SRCIT , Show2TEEN , Show2CHILD , Show2Total , 
			Show3Date , Show3REG , Show3SRCIT , Show3TEEN , Show3CHILD , Show3Total , 
			Show4Date , Show4REG , Show4SRCIT , Show4TEEN , Show4CHILD , Show4Total , 
			Show5Date , Show5REG , Show5SRCIT , Show5TEEN , Show5CHILD , Show5Total , 
			Show6Date , Show6REG , Show6SRCIT , Show6TEEN , Show6CHILD , Show6Total , 
			Show7Date , Show7REG , Show7SRCIT , Show7TEEN , Show7CHILD , Show7Total , 
			Show8Date , Show8REG , Show8SRCIT , Show8TEEN , Show8CHILD , Show8Total , 

			PKG1REG , PKG1SRCIT , PKG1TEEN , PKG1CHILD , PKG1Total , P1later ,
			PKG1Show1Date , PKG1Show2Date , PKG1Show3Date , PKG1Show4Date , PKG1Show5Date , PKG1Show6Date , PKG1Show7Date ,

			PKG2REG , PKG2SRCIT , PKG2TEEN , PKG2CHILD , PKG2Total , P2later ,
			PKG2Show1Date , PKG2Show2Date , PKG2Show3Date , PKG2Show4Date , PKG2Show5Date , PKG2Show6Date ,

			GCREG , GCSRCIT , GCTEEN , GCCHILD , GCTotal ,

			SubTotal , AddTran , TaxCalc , Donation , GrandTotal  )";

    $query .= " VALUES
             (  '$FirstName' , '$LastName' , '$StreetAddress1' , '$StreetAddress2' , '$City' , '$State' , '$Zip' ,  '$Email' ,
			'$CreditCardNumber' ,   '$ExpirationMonth' , '$ExpirationYear' , '$SeatPref' ,
			'$Show1Date' , '$Show1REG' , '$Show1SRCIT' , '$Show1TEEN' , '$Show1CHILD' , '$Show1Total' , 
			'$Show2Date' , '$Show2REG' , '$Show2SRCIT' , '$Show2TEEN' , '$Show2CHILD' , '$Show2Total' , 
			'$Show3Date' , '$Show3REG' , '$Show3SRCIT' , '$Show3TEEN' , '$Show3CHILD' , '$Show3Total' , 
			'$Show4Date' , '$Show4REG' , '$Show4SRCIT' , '$Show4TEEN' , '$Show4CHILD' , '$Show4Total' , 
			'$Show5Date' , '$Show5REG' , '$Show5SRCIT' , '$Show5TEEN' , '$Show5CHILD' , '$Show5Total' , 
			'$Show6Date' , '$Show6REG' , '$Show6SRCIT' , '$Show6TEEN' , '$Show6CHILD' , '$Show6Total' , 
			'$Show7Date' , '$Show7REG' , '$Show7SRCIT' , '$Show7TEEN' , '$Show7CHILD' , '$Show7Total' , 
			'$Show8Date' , '$Show8REG' , '$Show8SRCIT' , '$Show8TEEN' , '$Show8CHILD' , '$Show8Total' , 

			'$PKG1REG' , '$PKG1SRCIT' , '$PKG1TEEN' , '$PKG1CHILD' , '$PKG1Total' , '$P1later' ,
			'$PKG1Show1Date' , '$PKG1Show2Date' , '$PKG1Show3Date' , '$PKG1Show4Date' , '$PKG1Show5Date' , '$PKG1Show6Date' , '$PKG1Show7Date' ,

			'$PKG2REG' , '$PKG2SRCIT' , '$PKG2TEEN' , '$PKG2CHILD' , '$PKG2Total' , '$P2later' ,
			'$PKG2Show1Date' , '$PKG2Show2Date' , '$PKG2Show3Date' , '$PKG2Show4Date' , '$PKG2Show5Date' , '$PKG2Show6Date' ,

			'$GCREG' , '$GCSRCIT' , '$GCTEEN' , '$GCCHILD' , '$GCTotal' ,

			'$SubTotal' , '$AddTran' , '$TaxCalc' , '$Donation' , '$GrandTotal'  )";


echo $query . "<br>\n";

    $result = mysql_query($query);
    mysql_free_result($result);
    mysql_close($link);
}
?>

</body>
</html>

 

 

Link to comment
https://forums.phpfreaks.com/topic/143524-trouble-with-my-php-code/
Share on other sites

Thanks for the quick replies.

 

However, I've implemented both suggestions and still nothing.  I only get a blank page.  I have no idea which section of my code is causing problems.

 

Could it be a problem with my provider?  I tested the example I started with and it worked just fine.

Here is the resulting source code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252"></HEAD>
<BODY></BODY></HTML>

 

My service provider doesn't allow access or the ability to upload .htaccess files.

 

I also looked at the functions my service provider allows for PHP and it looks all of mine are allowed.

 

I'm not sure what to do next.

The second code I posted was the resulting source code.  I entered information into the form and clicked submit.  After the Submitted.php file loaded.  I clicked view source in IE and then copy and pasted it to a message.  I'm not sure why it went from lower case to capitalized.  Is that part of my problem?

When error reporting is turned off, the output seen is what php outputs for a fatal parse error.

 

Your code contains a fatal parse error -

 

Parse error: parse error, expecting `T_VARIABLE' or `'$'' in yourfile.php on line 732

 

http://www.phpfreaks.com/forums/index.php/topic,236832.msg1102555.html#msg1102555

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.