Hallo Forum, ich möchet gerne die auswahl der Formular-Optionsfelder
in eine andere Funktion übergeben. Wäre net wenn ihr mir weiterhelfen können.
mfg Woysch
in eine andere Funktion übergeben. Wäre net wenn ihr mir weiterhelfen können.
mfg Woysch
PHP-Code:
<?php
// - Function form_test
function form_test(){
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n
<html>\n
<head>\n
<title>Test</title>\n
</head>\n
<body>\n
<form action=\"http://localhost/test.php?pa=save_test\" method=\"post\">\n
<table>\n
<tr>\n
<td><select name=\"test_01_01\"><option>A</option><option>B</option></select></td>\n
<td><select name=\"test_01_02\"><option>A</option><option>B</option></select></td>\n
<td><select name=\"test_01_03\"><option>A</option><option>B</option></select></td>\n
<td><select name=\"test_01_04\"><option>A</option><option>B</option></select></td>\n
<td><select name=\"test_01_05\"><option>A</option><option>B</option></select></td>\n
</tr><tr>\n
<td><select name=\"test_02_01\"><option>A</option><option>B</option></select></td>\n
<td><select name=\"test_02_02\"><option>A</option><option>B</option></select></td>\n
<td><select name=\"test_02_03\"><option>A</option><option>B</option></select></td>\n
<td><select name=\"test_02_04\"><option>A</option><option>B</option></select></td>\n
<td><select name=\"test_02_05\"><option>A</option><option>B</option></select></td>\n
</tr><tr>\n
</table>\n
<table>\n
<tr>\n
<td><input type=\"hidden\" name=\"pa\" value=\"save_test\">\n
<input type=\"submit\" value=\" Speichern \"></td>\n
</tr>\n
</table>\n
</form>\n
</body>\n
</html>\n";
}
// - Function save_test
function save_test(){
error_reporting(E_ALL);
echo "<pre>\n";
print_r($_GET);
var_dump($_GET);
echo "</pre>\n";
echo "<br>\n<a href=\"http://localhost/test.php?pa=form_test\">Test Form</a>\n";
}
// -- switch
switch ($_GET['pa']) {
case "form_test":
form_test();
break;
case "save_test":
save_test();
break;
default:
form_test();
}
?>
Kommentar