If anyone knows of the Nintendo Wii Virtual Console; that's good, I am making a 'simple' calculator that allows you (regardless of region) to find how many Wii points you would have after you downloaded some retro games onto the Wii. All I need is help with a foreach loop. Here is the PHP file (that does the interpreting of the form):
<?PHP
// ======================================================================
=====
// NORTH AMERICA
// ======================================================================
=====
$_PRICES['NES'] = 500;
$_PRICES['SNES'] = 800;
$_PRICES['N64'] = 1000;
$_PRICES['GEN'] = 800;
$_PRICES['TURBO'] = 600;
//---------------------------------------------------------------------------
// SOUTH AMERICA
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
// EUROPE
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
// ASIA
//---------------------------------------------------------------------------
/*
$_PRICES['FAM'] = 500;
$_PRICES['SFAM'] = 800;
$_PRICES['N64'] = 1000;
$_PRICES['MASTER'] = 800;
$_PRICES['PC'] = 600;
*/
//---------------------------------------------------------------------------
// OTHER
//---------------------------------------------------------------------------
$total = 0;
foreach ($_PRICES as $current_game)
{
}
?>
What follows is the form, form.html.
<html>
<head>
<title>Virtual Console Calculator</title>
Welcome one, welcome all!
To this Virtual Console Calculator. This script is to help you decide on what Virtual Console games you'd like to download onto your Nintendo Wii. Simply check the boxes of the game(s) you'd like to download & (how many wii points you'd have after the last download is done), and input (at the bottom) amount of Wii points you have, and submit.
<body>
<form action=wii.php method=POST>
<table border=0 width=100%>
<tr>
<td><input type="checkbox" /><strong>N</strong>intendo <strong>E</strong>ntertainment <strong>S</strong>ystem
<td><input type="checkbox" name="NES []" />Donkey Kong </td>
<td><input type="checkbox" name="NES []" />Mario Bros </td>
<td><input type="checkbox" name="NES []" />Pinball </td>
<td><input type="checkbox" name="NES []" />Soccer </td>
<td><input type="checkbox" name="NES []" />Solomon's Key </td>
<td><input type="checkbox" name="NES []" />Legend of Zelda </td>
<td><input type="checkbox" name="NES []" />Wario's Woods </td>
<td><input type="checkbox" name="NES []" />Donkey Kong Jr </td>
<td><input type="checkbox" name="NES []" />Ice Hockey </td>
<td><input type="checkbox" name="NES []" />Tennis </td>
<td><input type="checkbox" name="NES []" />Super Mario Bros </td>
<td><input type="checkbox" name="NES []" />Baseball </td>
<td><input type="checkbox" name="NES []" />Urban Champion </td>
</tr>
<tr>
<td><input type="checkbox" /><strong>S</strong>uper <strong>N</strong>intendo <strong>E</strong>ntertainment <strong>S</strong>ystem</td>
<td><input type="checkbox" name="SNES []" />F-Zero </td>
<td><input type="checkbox" name="SNES []" />SimCity </td>
<td><input type="checkbox" name="SNES []" />Street Fighter II: The World Warrior </td>
<td><input type="checkbox" name="SNES []" />Super Castlevania IV </td>
</tr>
<tr>
<td><input type="checkbox" /><strong>N</strong>intendo <strong>64</strong>
<td><input type="checkbox" name="N64 []" />Mario 64 </td>
</tr>
<tr>
<td><input type="checkbox" name="GEN []" />Sega Genesis
<td><input type="checkbox" name="GEN []" />Altered Beast </td>
<td><input type="checkbox" name="GEN []" />Sonic The Hedgehog </td>
<td><input type="checkbox" name="GEN []" />Ecco the Dolphin </td>
<td><input type="checkbox" name="GEN []" />Golden Axe </td>
<td><input type="checkbox" name="GEN []" />Columns </td>
<td><input type="checkbox" name="GEN []" />Ristar </td>
<td><input type="checkbox" name="GEN []" />Dr. Robotnik's Mean Bean Machine </td>
<td><input type="checkbox" name="GEN []" />Gunstar Heroes </td>
<td><input type="checkbox" name="GEN []" />Space Harrier II </td>
<td><input type="checkbox" name="GEN []" />ToeJam & Earl </td>
</tr>
<tr>
<td><input type="checkbox" name="TURBO []" />Turbo Grafix 16 </td>
<td><input type="checkbox" name="TURBO []" />Bomberman '93 </td>
<td><input type="checkbox" name="TURBO []" />Bonk's Adventure </td>
<td><input type="checkbox" name="TURBO []" />Super Star Soldier </td>
<td><input type="checkbox" name="TURBO []" />Victory Run </td>
<td><input type="checkbox" name="TURBO []" />Alien Crush </td>
<td><input type="checkbox" name="TURBO []" />Military Madness </td>
<td><input type="checkbox" name="TURBO []" />R-Type </td>
</tr>
</table>
<input type="text" value="" /> <input type="submit" value="Calculate Wii points" /> <input type="reset" value="Reset this form" />
</form>
</body>
</head>
</html>
The script does NOT use functions, if-statements (of any kind), just:
$POST
$PRICES
$current_game
$total
+=
That is it! Nothing else (I think, I can't rememeber)