<?php
// the options
$browsers = array(
"" => "-- Select --",
"__LABEL(IE)__" => "Microsoft Internet Explorer",
"msie3" => "Microsoft Internet Explorer 3",
"msie4" => "Microsoft Internet Explorer 4",
"msie5" => "Microsoft Internet Explorer 5",
"msie55" => "Microsoft Internet Explorer 5.5",
"msie6" => "Microsoft Internet Explorer 6",
"__LABEL(MO)__" => "Mozilla",
"moz1" => "Mozilla 1",
"__LABEL(NN)__" => "Netscape Navigator",
"nn3" => "Netscape Navigator 3",
"nn4" => "Netscape Navigator 4",
"nn6" => "Netscape Navigator 5",
"nn6" => "Netscape Navigator 6",
"nn7" => "Netscape Navigator 7",
"__LABEL(OP)__" => "Opera",
"op3" => "Opera 3",
"op35" => "Opera 3.5",
"op4" => "Opera 4",
"op5" => "Opera 5",
"op6" => "Opera 6",
"op7" => "Opera 7"
);
// include the class
include('FH3/class.FormHandler.php');
// create a new formhandler object
$form = new FormHandler();
// the field
$form -> selectField("Your browser", "browser", $browsers, FH_NOT_EMPTY, true);
// button beneath it
$form -> submitButton("Save");
// set the 'commit after form' function
$form -> onCorrect("doRun");
// send the form to the screen
$form -> flush();
// the function witch handles the code after the form
function doRun($data)
{
return "Your browser: ". $data["browser"];
}
?> |