'red', 1 => 'orange', 2 => 'yellow', 3 => 'green', 4 => 'blue', 5 => 'white', 6 => 'black'); $min = 0; $max = 6; // // get the desired state $state=$_POST[state]; // // get the variables accepted to a known state if ("$state" < "$min" || "$state" > "$max" ) { $state = $min ; } // $PHP_SELF=$_SERVER['PHP_SELF']; // print "\n"; // // and do something print ""; print "\n"; $color = $rotor[$state] ; print "
  Rotor " . "state: " . $state . " 
 Color:  " . $color . "  " . "

\n"; // $state ++; // // and let it do something neat print "
\n
\n\n"; // ?>