How can I get the value of a switch case coming from the drop down form

Hi I have a form that is popluated from the database now I am trying to get the switch case to be based on the option the user selects is this possible to make a case a variable popluated by the drop down if so can someone show me what am i missing?
the value I am trying to get from the form to the switch case is the ( $val->slug) but the value not been set help please

here the form

                                       <form method="post">
                                           <select name="deal-locations" onChange="this.form.submit()">
                                             <?php
                                             	while(list($key,$val) = each($locations)) {
                                             ?><option value="<?php echo $val->slug; ?>"><?php echo $val->slug; ?></option><?php
                                                 }
                                              ?>
                                           </select>
                                           <input type="submit" value="submit">
                                       </form>

Here the switch case

 switch ($_POST['deal-locations'])
   {
       case " $val->slug": echo "<h3>deal-locations: ASC</h3>";
           $args = array(
                 's' => $_GET['s'],
                 'post_type' => 'deals',
                 'deal-locations' => ' $val->slug',
                 'where' => ' $val->slug',
                 'paged' => 'paged'
                );
           break;
}

switch case is similar to if elseif

This page gives you example of its usage:
http://us.php.net/manual/en/control-structures.switch.php

Your example would be something like this:

<?php
   switch ($_POST['deal-locations'])
   { 
	   case "ASC": echo "<h3>deal-locations: ASC</h3>";
		       $args = array(
				     's' => $_GET['s'],
				     'post_type' => 'deals',
				     'deal-locations' => ' $val->slug',
				     'where' => ' $val->slug',
				     'paged' => 'paged'
				    );
		       break;
	   case "...": // ... = from your option values
 		   // code to handle this case
		   break;
   }
?>

Hi thanks for your response. I actually did look at the link you sent me before unfortunnaly the drop down option values is also populated by from the database so I do not want to everytime i create a new location I have to go in the code and add if location = france else location= england, i do not want to do that every single time so I want the case “$variable” so that whatver is on the options and selected will populate that case inside the switch function.
($val->slug) I want this variable on the switch case, if thats is possible like the one bellow
one problem

    switch ($_POST['deal-locations'])
   {
       case "".$val->slug.""->slug: echo "<h3>deal-locations: "".$val->slug.""</h3>";
           $args = array(
                 's' => $_GET['s'],
                 'post_type' => 'deals',
                 'deal-locations' => "".$val->slug."",
                 'where' => "".$val->slug."",
                 'paged' => 'paged'
                );
           break;

But it doesnt “”.$val->slug.“” doesnt get any value from the form?

 <form method="post">
                                           <select name="deal-locations" onChange="this.form.submit()">
                                             <?php
                                             	while(list($key,$val) = each($locations)) {
                                             ?><option value="<?php echo $val->slug; ?>"><?php echo $val->slug; ?></option><?php
                                                 }
                                              ?>
                                           </select>
                                           <input type="submit" value="submit">
                                       </form>

Although those values are in the database but you still should have a list of all the known values.

What you need to do is put each one of those values in a case statement and to provide the appropriated code for it. The list maybe long if you were to include all the countries in the world. Or you could just process those that that are important like this:

<?php
   $val->slug = $_POST['deal-locations'];
   switch ($val->slug)
   {
	   case "United Kingdom": echo "1<h3>deal-locations: $val->slug</h3>";
				  $args = array(
						's' => $_GET['s'],
						'post_type' => 'deals',
						'deal-locations' => $val->slug,
						'where' => $val->slug,
						'paged' => 'paged'
					       );
				  break;
	   case "France": echo "2<h3>deal-locations: $val->slug</h3>";
				  $args = array(
						's' => $_GET['s'],
						'post_type' => 'deals',
						'deal-locations' => $val->slug,
						'where' => $val->slug,
						'paged' => 'paged'
					       );
				  break;
	   case "Germany": echo "3<h3>deal-locations: $val->slug</h3>";
				  $args = array(
						's' => $_GET['s'],
						'post_type' => 'deals',
						'deal-locations' => $val->slug,
						'where' => $val->slug,
						'paged' => 'paged'
					       );
				  break;
	   default: echo "4<h3>deal-locations: $val->slug</h3>This location is not supported";
   }
?>

If all the countries were used the same code for processing then you could simply use this:

   $val->slug = $_POST['deal-locations'];
   if($val->slug)
   {
	   $args = array(
			 's' => $_GET['s'],
			 'post_type' => 'deals',
			 'deal-locations' => $val->slug,
			 'where' => $val->slug,
			 'paged' => 'paged')
   }

There is no need for switch/case.

Thanks for the help guys, tom8 yeah the if statment is working exacly how I thought I could achieve with the switch statment, it is exacly how I wanted Thanks for all the help everybody.