HERE IS MY CODE,
ITS NOT WORKING AS ITS SUPPOSED TO
IM NOT SURE WERE IM OFF
IF SOMEONE COULD HELP ME OUT PLEASE AND THANK YOU
🙁
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="EN" dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
<head>
<style>
body
{
background-color:#FF00FF;
}
h1
{
color:orange;
text-align:center;
}
p
{
font-family:"Times New Roman";
font-size:20px;
}
h1 {text-align:center;
}
</style>
<title>NERD ROUNDUP 2013</title>
</head>
<body>
<h1>AUGUST 7-10 ATLANTA, GA </h1>
<?php
// define the variables
$fName = $_POST["fName"];
$lName = $_POST ["lName"];
$city = $_POST ["city"];
$state = $_POST ["state"];
$zipCode = $_POST["zipCode"];
$other = $_POST ["other"];
$chkOne = $_POST["chkOne"];
$chkTwo = $_POST["chkTwo"];
$chkThree = $_POST["chkThree"];
$mealPlan = $_POST[""];
//1 to 1000
//generate conf id number
$confId = rand(1,1000);
$no_errors = TRUE;
$total = 0;
//begin form filter
if(!isset($_POST['mealPlan']) &&
$_POST['mealPlan'] == 'Yes')
{ $mealPlan== 'Yes';
$no_errors = FALSE;
}
checkInput();
calcPrice();
printConf();
//checkInput
function checkInput() {
if (filter_has_var(INPUT_POST, "chkOne"))
{
$total += filter_input(INPUT_POST, "chkOne");
}
if (filter_has_var(INPUT_POST, "chkTwo"))
{
$total += filter_input(INPUT_POST, "chkTwo");
}
if (filter_has_var(INPUT_POST, "chkThree"))
{
$total += filter_input(INPUT_POST, "chkThree");
} //end $total
// what conference track are they on
$track = filter_input(INPUT_POST, "track");
if(empty($fName))
{
$no_errors = FALSE;
echo '***FIRST NAME FIELD REQUIRED***** <br />' ;
} //get users first name
if(empty($lName))
{
$no_errors = FALSE;
echo '****LAST NAME FIELD REQUIRED***** <br /> ';
} // get users last name
if(empty($city))
{
$no_errors = FALSE;
echo '****CITY FIELD REQUIRED***** <br /> ';
}
//get user city
if(empty($state))
{
$no_errors = FALSE;
echo '***STATE NAME FIELD REQUIRED***** <br /> ';
}
//get user state
if(empty($zipCode))
{
$no_errors = FALSE;
echo '****ZIPCODE FIELD REQUIRED***** <br /> ';
}
//get user zip code
if(empty($other))
{
$no_errors = FALSE;
echo '****TEXT FIELD REQUIRED***** <br /> ';
}
//get user additional comments
//beging function calculateCost
function calcPrice()
{
$confTotal =filter_input(INPUT_POST,"confTotal");
$total = filter_input (INPUT_POST, "total");
$mealPlan = filter_input (INPUT_POST, "mealPlan");
IF (! filter_has_var (INPUT_POST, "mealPlan" ))
{
$total =="100" ; $confTotal = $total+= 50;
}
else
if ($total=="175")
{
$confTotal = $total +=75;
}
else
if ($total =="225")
{
$confTotal = $total +=100;
$no_errors == TRUE;
}}
//end function cacluclateCost
if ($no_errors == FALSE)
{
echo "<br> <a href='major1progress.html'>Go back to form</a>";
}
}//end function checkInput
//begin function printConf
function printConf()
{
$no_errors = FALSE;
if ($no_errors == TRUE)
{
print " <p> $fName $lName, <br />you have registered for Nerd Roundup 2013<br />
your planned track is $track<br />
The total cost is: \$$total <br />
<br /> Please make sure to bring cash, or your credit card to
pay for the conference on the first day<br />
Your additional comments are as follows:
$other <br /> </p>
<p>Your Nerd Roundup confirmation number is $confId .</p> <br /> \n";
}
}
//end function printConf
?>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="EN" dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
<style>
body
{
color:black;
font-size:20px;
}
h1
{
color:orange;
text-align:center;
font-size:30px;
}
p
{
font-family:"Times New Roman";
font-size:20px;
}
</style>
<title> NERD ROUNDUP TECHNOLOGY CONVENTION </title>
</head>
<body>
<h1>AUGUST 7-10 ATLANTA GA </h1>
<form method = "POST"
action = "threeprogress.php">
<fieldset>
<label>
Please type your first name:
</label>
<input type = "text"
name = "fName"
value = "" /> <br />
<label>
Please type your Last name:
</label>
<input type = "text"
name = "lName"
value = "" /> <br />
Please type your city:
<input type = "text"
name = "city"
value = "" /> <br />
Please type your State:
<input type = "text"
name = "state"
value = "" /> <br />
Please type your Zipcode:
<input type = "text"
name = "zipCode"
value = "" /> <br />
<label for="other">Anything else you want to add?</label>
<textarea id="other" name="other"></textarea><br />
<fieldset>
<legend>HOW MANY DAYS</legend>
<input type = "checkbox"
name = "chkOne"
value = "100.OO" /><label>ONE DAY $100.00</label>
<input type = "checkbox"
name = "chkTwo"
value = "175.00" /><label>TWO DAYS $175.00</label>
<input type = "checkbox"
name = "chkThree"
value = "325.00" /><label>THREE DAYS $325.00</label>
<br />
<fieldset>
Please Check If you would Like The Meal Plan Added to your total.
<input type="checkbox" name="mealPlan" value="Yes" />
<br />
<br />
<select name = "track">
<option value = "PROGRAMMING TRACK">PROGRAMMING TRACK</option>
<option value = "NETWORKING TRACK">NETWORKING TRACK</option>
<option value = "SECURITY TRACK">SECURITY TRACK</option>
<option value = "WEB TRACK">WEB TRACK</option>
</select>
<button type = "submit">
place order
</button>
</fieldset>
</form>
</body>
</html>