Here is what I am trying to do.
I am going to have a select menu of contries - canada, usa, mexico, etc - I have a integer value assigned to each of them in the define block.
I want to have all that in the define block into a variable called $distance - which will then carry on putting data in a table.
<?php
define('candis', 100);
define('usadis', 200);
define('mexdis', 300);
define('eurodis', 800);
define('asiadis', 900);
define('afrdis', 850);
define('ausdis', 500);
switch ($location)
{
case 'canada' :
echo '<p>Canada = '.$candis.' miles.</p>';
break;
case 'usa' :
echo '<p>USA = '.$usadis.' miles.</p>';
break;
case 'mexico' :
echo '<p>Mexico = '.$mexdis.' miles.</p>';
break;
case 'europe' :
echo '<p>Europe = '.$eurodis.' miles.</p>';
break;
case 'asia' :
echo '<p>Asia = '.$asiadis.' miles.</p>';
break;
case 'africa' :
echo '<p>Africa = '.$afrdis.' miles.</p>';
break;
case 'austrailia' :
echo '<p>Austrailia = '.$ausdis.' miles.</p>';
break;
default :
echo '<p>No clue whre you are from.</p>';
break;
}
$distance = 50;
while ($distance <= 250)
{
echo "<tr>\n <td align"="right">. $distance</td>\n";
echo "<td align="right">". $distance / 10 ."</td>\n</tr>\n";
$distance += 50;
}
?>
Also - I am getting a parse error on the 2 echo statements within the while loop....do they look OK?