1. when user type input in the form and click submit button, when input is error the form was show again and retain the data that the user submitted when the error was displayed
please Look at this two code.
and compare with thisPHP Code:<INPUT TYPE="text" NAME="first" VALUE="<?php echo $HTTP_POST_VARS['first']; ?>">
two method give same result that display data in the textbox that user type in it.PHP Code:<INPUT TYPE="text" NAME="first" VALUE="<?php echo $first ?>">
Is different between
$HTTP_POST_VARS['first']
and
$first
----------------------------------------------------
2. I see many code like this
this code include form html. Why they use *.ihtml instead *.html ? What different?PHP Code:<?php if($action == "display") {
include("form.ihtml");
} elseif ($action == "process") {
include("success.ihtml");
} else {
include("error.ihtml");
}
?>
---------------------------------------------------
3. continue from question 1 this code below
Can you explain me what does it mean?PHP Code:foreach($HTTP_POST_VARS as $key => $val) {
$funcname = "validate_$key";
if(function_exists($funcname)) {
if(!$funcname($val)) {
$errors[] = "Field $key was invalid";
}
}
}
foreach($HTTP_POST_VARS as $key => $val)
------------------------------------------
Thank You.
![]()




Bookmarks