<?php
  $SelectValid = 1;

  if( !isset( $_POST{'Color'} ) )
    $DisplayBlock =  "<form action=\"{$_SERVER{'PHP_SELF'}}\" method=\"post\">
                        <p style=\"font:18pt helvetica; color:#050050;\">
                          Esta caja est&aacute;
                          <input type=\"text\" name=\"Caja1\" size=\"10\"
                                 maxlength=\"8\" value=\"ReadOnly\" 
                                 readonly=\"readonly\" />
                          <br />
                          Esta caja est&aacute;
                          <input type=\"text\" name=\"Caja2\" size=\"10\"
                                 maxlength=\"8\" value=\"Disabled\" 
                                 disabled=\"disabled\" />
                          <br /><br />
                          Que Color? ( \"Verde\", \"Rojo\" o \"Azul\" )
                          <input type=\"text\" name=\"Color\" size=\"10\"
                                 maxlength=\"5\" value=\"Azul\" />
                        </p>
                        <p>
                          <input type=\"submit\" name=\"Submit\" 
                                 value=\"Enviar\" />
                          &nbsp;&nbsp;&nbsp;&nbsp;
                          <input type=\"reset\" name=\"Reset\" 
                                 value=\"Reset\" />
                        </p>
                      </form>";
  else
  {
    switch( strtolower( $_POST{'Color'} ) )
    {
      case "azul":
        $Color = "#0000AA";
        break;
      case "rojo":
        $Color = "#AA0000";
        break;
      case "verde":
        $Color = "#00AA00";
        break;
      default:
        $SelectValid = 0;
    }
    if( $SelectValid )
      $DisplayBlock =  "<p style=\"font:18pt helvetica; color:{$Color};\">
                          Enviaste el color: {$_POST{'Color'}}
                        </p>
                        <p style=\"font:12pt helvetica; color:#050050:\">
                          <a href=\"TextColorPOST.php\">
                            Selecci&oacute;na otro color</a>
                        </p>";
    else
      header( "Location: MensajeError.php?Errno=1003&Var={$_POST{'Color'}}" );
  }
  require_once( "Cabeza5.inc" );
  print( $DisplayBlock );
  require_once( "incPie5.php" );
?>