hi there I just modified your source code hope to help somebody!!
byeee
Julio
gugli100@gmail.com
<?php
function validate_form(){
echo "<br>validado";
if (isset( $_POST['input1'] )) $input1 = $_POST['input1'];
if (isset( $_POST['input2'] )) $input2 = $_POST['input2'];
if (isset( $_POST['input3'] )) $input3 = $_POST['input3'];
if ($input1==1)
$ListaErrores["Error1"]="Ingrese la 1";
if ($input2==2)
$ListaErrores["Error2"]="Ingrese la 2";
if ($input3==3)
$ListaErrores["Error3"]="Ingrese la 3";
return $ListaErrores;
}
function show_form(){
if ($num_args = func_num_args()>0)
$Errores=func_get_arg(0);
if (array_key_exists('_submit_check',$_POST)) {
// If validate_form() returns errors, pass them to show_form()
if ($form_errors = validate_form()) {
show_form($form_errors);
} else {
// The submitted data is valid, so process it
process_form();
}
} else {
// The form wasn't submitted, so display
show_form();
}
?>
Showing messages 1 through 3 of 3.
hi!!! from Lima Perú
2006-04-16 07:54:42
MarcelJong
[Reply | View]
Hello Julito. When I run this code exactly as stated here I get the following error messages:
Notice: Undefined variable: Errores in c:\data\dev\forms\test.php on line 29
NUMBER2
Notice: Undefined variable: Errores in c:\data\dev\forms\test.php on line 31
NUMBER3
Notice: Undefined variable: Errores in c:\data\dev\forms\test.php on line 33
hi!!! from Lima Perú
2007-12-05 22:10:54
pot
[Reply | View]
hi!!! from Lima Perú
2007-08-26 05:16:00
julito_montoya
[Reply | View]
Hello MarcelJong,
I just review the code and works fine.
Maybe is the version of your Apache/PHP
bye
Notice: Undefined variable: Errores in c:\data\dev\forms\test.php on line 29
NUMBER2
Notice: Undefined variable: Errores in c:\data\dev\forms\test.php on line 31
NUMBER3
Notice: Undefined variable: Errores in c:\data\dev\forms\test.php on line 33