No, in this case, the switch is assuming the value of the variable $location to be a country name... canada, usa, mexico, etc.
If you are passing a country name into the location variable, then you would need to reassign a value to location based on the country name, then the $location variable would be set to a value to use in your while loop below...
Although, I am not sure where your $distance variable is coming from in the WHILE loop...
Try this:
<?php
$candis = 100;
$usadis = 200;
$mexdis = 300;
$eurodis = 800;
$asiadis = 900;
$afrdis = 850;
$ausdis = 500;
switch ($location)
{
case 'canada' :
echo '<p>Canada = '.$candis.' miles.</p>';
$location = $candis;
break;
case 'usa' :
echo '<p>USA = '.$usadis.' miles.</p>';
$location = $usadis;
break;
case 'mexico' :
echo '<p>Mexico = '.$mexdis.' miles.</p>';
$location = $mexdis;
break;
case 'europe' :
echo '<p>Europe = '.$eurodis.' miles.</p>';
$location = $eurodis;
break;
case 'asia' :
echo '<p>Asia = '.$asiadis.' miles.</p>';
$location = $asiadis;
break;
case 'africa' :
echo '<p>Africa = '.$afrdis.' miles.</p>';
$location = $afrdis;
break;
case 'austrailia' :
echo '<p>Austrailia = '.$ausdis.' miles.</p>';
$location = $ausdis;
break;
default :
echo '<p>No clue whre you are from.</p>';
break;
}
//$location = 50;
while ($location <= 250)
{
echo "<tr>\n <td align='right'>$distance</td>\n";
echo " <td align='right'>". $location / 10 ."</td>\n</tr>\n";
$location += 50;
}
?>