Jump to content

[SOLVED] IF STATEMENT/VARIABLE HELP!!!


burkee25

Recommended Posts

Hi lads,

Im wrecking my head trying to solve this code!  any help would be much appreciated!

 

So I have a html page, with an option to pick your favourite team, and then on the php page i want to show a picture of the selected team!

 

This is from the original html page:

<body>
form action="phpassign.php" method="post">
<!--Form for favourite team -->
<h3>Selcet your favourite team</h3>
<select name="team" id="team">
<option $team value="Mancheter United">Man Utd</option>
<option value="Asrenal">Asrenal</option>
<option value="Chelsea">Chelsea</option>
<option value="Liverpool">Liverpool</option>
</select>
</body>

 

 

Then I Have the PHP file:

<body>
<?php
$team = $_GET['team'];

if ( $team== "Manchester United" ) {
   echo "<img src=man_utd.jpg><br />";
}
echo "Welcome to my homepage!";

echo $_POST['team'];
echo ".<br /> "; 
echo $_POST['color'];
?>
</body>
</html>

 

Any help would be great! :)

 

Link to comment
https://forums.phpfreaks.com/topic/131933-solved-if-statementvariable-help/
Share on other sites

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.