How to display errors all at once rather than one at a time?
<p>In code below it is suppose to contains all the errors in an array and then display the errors in one depening on which errors are activated. But problem is that it is still displaying the errors only one at a time, it is not displaying att the relevant errors at once. What do I need to change in order to do this?</p>

<pre><code>$errors = array();


          if (!$getcourseid){
              $errors[] = "You must enter in Course's ID";
      }else if (!$getcoursename){
          $errors[] = "You must enter in Course's Name";
      }else if (!$getduration){
              $errors[] = "You must select Course's Duration";
          }     



    if(empty($errors)) {
        if ($numrows == 1){
       $errormsg = "&lt;span style='color: green'&gt;Course " . $getcourseid .  " - "  . $getcoursename . " has been Created&lt;/span&gt;";
       $getcourseid = "";
       $getcoursename = "";
       $getduration = "";
    }else{
        $errormsg = "An error has occured, Course has not been Created";
    }
    } else {
        if(isset($errors[0])) {
           $errormsg = $errors[0]; 
        } elseif (isset($errors[1])) {
           $errormsg = $errors[1];
        } elseif (isset($errors[1])) {
            $errormsg = $errors[1]; 
        }
    }         
</code></pre>
