Quote (carteblanche @ Dec 10 2015 11:10am)
I don't mind helping if you post your code and what your problem is, but I'm not interested in doing your assignment.
I assume it's due another day, as opposed to posting after midnight when it's due in the morning.
Your are correct it's due tomorrow. This is what I have so far. I was able to get the program to work using a template file, php file, and a form file, but I would like the form and html to be one file, and the php a file. I'm using xamp to run it.
Edit: I'm aware my code is way off, but this is what I had in mind for a starting point.
Quote
<?php
$years = array(
'2000' => 'St. Louis Rams',
'2001' => 'Baltimore Ravens',
'2002' => 'New England Patriots',
'2003' => 'Tampa Bay Buccaneers',
'2004' => 'New England Patriots',
'2005' => 'New England Patriots',
'2006' => 'Pittsburg Steelers',
'2007' => 'Indianapolis Colts',
'2008' => 'New York Giants',
'2009' => 'Pittsburg Steelers',
'2010' => 'New Orleans Saints',
'2011' => 'Green Bay Packers',
'2012' => 'New York Giants',
'2013' => 'Baltimore Ravens',
'2014' => 'Seattle Seahawks',
'2015' => 'New England Patriots'
);
if(isset($_POST['years'])){
$select1 = $_POST['years'];
switch ($years) {
case '2000':
echo 'this is value1<br/>';
break;
case '2001':
echo 'value2<br/>';
break;
case '2002':
echo 'this is value1<br/>';
break;
case '2003':
echo 'value2<br/>';
break;
case '2004':
echo 'this is value1<br/>';
break;
case '2005':
echo 'value2<br/>';
break;
case '2006':
echo 'this is value1<br/>';
break;
case '2007':
echo 'value2<br/>';
break;
case '2008':
echo 'this is value1<br/>';
break;
case '2009':
echo 'value2<br/>';
break;
case '2010':
echo 'this is value1<br/>';
break;
case '2011':
echo 'value2<br/>';
break;
case '2012':
echo 'this is value1<br/>';
break;
case '2013':
echo 'value2<br/>';
break;
case '2014':
echo 'this is value1<br/>';
break;
case '2015':
echo 'value2<br/>';
break;
}
}
?>
Note the echo are all value, I did this so I can see if I atleast get an output. Which I am not. I will later change to the respect year winning team.
Quote
<!DOCTYPE html>
<!--SuperBowl.html - this describes the SuperBowl winner form, Eric Lovelace -->
<html lang = "en" >
<head>
<title> Superbowl Winners 2000 - 2015 </title>
<meta charset = "utf-8" />
<style type = "text/css" >
h1 { font-size:20px; border: thin solid black; color: darkblue;
background-color: lightblue; padding: 30px; left-margin: 15px; right-margin: 50px;
}
select {margin: 30px; font-size: 18px; color: darkblue;}
input {font-size: 16px; color: darkblue; padding: 3px;}
</style>
</head>
<body>
<form action = "http://localhost/myPrograms/superBowl.php" method = "post" >
<h1> Welcome to the Super Bowl Winner Search Years 2000 - 2015! <br /> <br />
Select the year, see the winning team!</h1>
<br />
<select name = "years" >
<option value = "2000"> 2000 </option>
<option value = "2001"> 2001 </option>
<option value = "2002"> 2002 </option>
<option value = "2003"> 2003 </option>
<option value = "2004"> 2004 </option>
<option value = "2005"> 2005 </option>
<option value = "2006"> 2006 </option>
<option value = "2007"> 2007 </option>
<option value = "2008"> 2008 </option>
<option value = "2009"> 2009 </option>
<option value = "2010"> 2010 </option>
<option value = "2011"> 2011 </option>
<option value = "2012"> 2012 </option>
<option value = "2013"> 2013 </option>
<option value = "2014"> 2014 </option>
<option value = "2015"> 2015 </option>
</select>
<input type="submit" id = "singleYear" value="Show winning Team ">
</form>
</body>
</html>
This post was edited by Zom8 on Dec 10 2015 03:57pm