d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > 1k Fg For Help On Program
Add Reply New Topic New Poll
Member
Posts: 10,715
Joined: Sep 1 2007
Gold: 11,037.49
Dec 9 2015 11:29pm
If you can remotely get me close to what I need done I'll pay the full 1k. Due by 8:00AM EST time. Last project of the year and I had some work issues arise and got behind. Thanks for the help in advance :D

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 = "year" >
<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>

Using PHP
Requirements: Use the html file provided with No changes. Notice it includes a <select> element building a drop-down box allowing the user to pick a year between 2000 - 2015. You are to write the php code that will use the selected year to return the winning team for that year. REMEMBER: You cannot assume any input from the client is valid, even if form input validation has been done in JavaScript and therefore you must include input validation in your PHP code. For the list of Super Bowl winners use any one of the many sources available on the Web. Your PHP code should provide a heading similiar to the one in the HTML template. You will then display a message indicating the winner for the year selected.

This post was edited by Zom8 on Dec 9 2015 11:30pm
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Dec 10 2015 10: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.
Member
Posts: 10,715
Joined: Sep 1 2007
Gold: 11,037.49
Dec 10 2015 03:52pm
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
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Dec 10 2015 08:37pm
do you have a particular question/issue? you said you have it working
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll