title: Parse Error in PHP Code unexpected T_CASE
body: <p>I am having some issues with my code, and keep getting the same error, i have checked to make sure i have no open brackets or not forgotten to close a line.</p>
  
  <p>The code below is only part of my whole code, this is lines 79-191 error is on line 109.</p>
  
  <pre><code>if(isset($id) &amp;&amp; isset($_SESSION['user_current'])){
  
      switch($option) {               
          case 1:
              $query = mysql_query("SELECT * FROM `ebcs_albums` WHERE `id` = '{$_SESSION[user_current][2]}'");
              $result = mysql_fetch_assoc($query);
              $img_ext = array('.jpeg','.jpg','.png','.gif'); 
              function getImages($dir) {
                  global $img_path, $img_ext;
                  $d = dir($img_path.$dir);  
                  while (false !== ($file = $d-&gt;read())) {
                      $file_basename = substr($file, 0, strripos($file, '.'));
                      $file_basename = rename($file_basename,strtolower(preg_replace('/[^A-Za-z0-9_-]+/', '-', $file_basename)));
                      $file_ext = substr($file, strripos($file, '.'));
                      $file_ext = rename(strtolower($file_ext));
                      $file = $file_basename.$file_ext;
                      if(in_array($file_ext,$img_ext)) {
                          $images[] = array('file' =&gt; $file,'size' =&gt; getimagesize($file));
                      }
                  }
                  $d-&gt;close();
                  asort($images);         
                  return $images;
              }
  
              $array = getImages($result['Albums_Folder']);
              foreach ($array as $img) {
                  mysql_query("INSERT INTO `ebcs_albums_temp` (`id`,`User`,`Image_Name`,`Image_Width`,`Image_Height`) 
                  VALUES ('','$user','{$img[file]}','{$img[size][0]}','{$img[size][1]}')");
              }
              goto case 3;
              break;
  
          case 2:     
              $query = mysql_query("SELECT * FROM `ebcs_albums_temp` WHERE `User` = '{$_SESSION[user_current][0]}'");
              $array = mysql_fetch_array($query);
              foreach ($array as $remove) {
                  mysql_query("DELETE FROM `ebcs_albums_temp` WHERE `id` = '{$remove[id]}'");
              }       
              mysql_query("DELETE FROM `ebcs_albums_users` WHERE `IP` = '{$_SESSION[user_current][0]}'");
              $id = $_SESSION['user_current'][2];
              unset($_SESSION['user_current']);   
  
              $query = mysql_query("SELECT * FROM `ebcs_albums_users` WHERE `Time` &gt; '$inactive'");
              $array = mysql_fetch_array($query);
              foreach ($array as $remove) {
                  $last = next($array)===false;
                  mysql_query("DELETE FROM `ebcs_albums_users` WHERE `id` = '{$remove[id]}'");
                  if(!$last){
                  mysql_query("DELETE FROM `ebcs_albums_temp` WHERE `User` = '{$remove[IP]}'");
                  }
              }               
              $_SESSION['error'] = 'You have be logged out.';
              echo '&lt;meta http-equiv="refresh" content="0;URL=album.php?id=$id"&gt;';
              break;
  
          case 3:     
              $query = mysql_query("SELECT DISTINCT User FROM `ebcs_albums_temp`");
              $array = mysql_fetch_array($query);
              if(in_array($_SESSION['user_current'][0],$array)) {
  
                      $query = mysql_query("SELECT Time FROM `ebcs_albums_users` WHERE `User` = '{$_SESSION[user_current][0]}'"); 
                      $mysql_time = mysql_fetch_assoc($query);    
  
                      $session_life = time() - $_SESSION['user_current'][1];
                      $mysql_life = time() - $mysql_time['Time'];
  
                      if(($session_life &gt; $inactive) || ($mysql_life &gt; $inactive)){
                          goto case 2;    
                          break;
                      }
  
                      SmartyPaginate::connect();
                      SmartyPaginate::setLimit(24);
                      $query = sprintf("SELECT SQL_CALC_FOUND_ROWS * FROM `ebcs_albums_temp` WHERE `User` = '$user' ORDER BY `id` LIMIT %d,%d", SmartyPaginate::getCurrentIndex(), SmartyPaginate::getLimit());
                      $results = mysql_query($query);                         
                          while($x = mysql_fetch_assoc($results)) {
                              $images[] = array('file' =&gt; $x['Image_Name'],'width' =&gt; $x['Image_Width'],'height' =&gt; $x['Image_Height']);
                          }
                      $query = "SELECT FOUND_ROWS() as total";
                      $_results = mysql_query($query);
                      $_row = mysql_fetch_assoc($_results);   
                      SmartyPaginate::setTotal($_row['total']);
  
                      SmartyPaginate::assign($smarty);    
  
                      $albums = mysql_query("SELECT * FROM `ebcs_albums` WHERE `id` = '{$_SESSION[user_current][2]}'");
                      $albums_arr = array();
                          while($x = mysql_fetch_assoc($albums)) {
                              $albums_arr[] = $x;
                          }
  
                      $smarty-&gt;assign('id',$id);
                      $smarty-&gt;assign('images',$images);
                      $smarty-&gt;assign('albums_arr',$albums_arr);
  
                      include ("_header.php");    
                      $smarty-&gt;display('album_images.tpl');
                      include ("_footer.php");                
                      break;
  
              } else {
                  goto case 1;    
                  break;
              }
          default:    
              break;
      }
  } else {                        
      $_SESSION['error'] = 'You are not logged in.';
      echo '&lt;meta http-equiv="refresh" content="0;URL=album.php?id=$id"&gt;';
  }   
  </code></pre>
  
  <p>Line 109 = goto case 3;
  Line 110 = break;</p>
  
  <p>Thanks for any help!</p>