Jump to content

[SOLVED] turnings if statements to switch


darkfreaks

Recommended Posts

switch ($_GET['error'])
{
     case name:
          echo "Please enter a name.";
     break;
     case age:
          echo "Please enter your age.";
     break;
}

 

there's an example where $_GET is a parameter sent in the URL from a pre-existing form submission which contains some errors.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.