PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
When a field (say textbox, checkbox) is not satisfying a condition. I set the variable $msg with the error msg & redirect to the form page where the field(s) are. The error shows but then if there is something in the text, or checkbox, or option button, the person has to re-fill the form again. Is there a way dat i can retain the values stored in the textbox as well as show my error msgs too with header function or with some other function (if available) or some other way dat i can do it
<?php
if (!isset($HTTP_POST_VARSїsend]) {
include 'form.inc';
}
// here is your code for error check
// if have error $msg is set
if (isset($msg)) {
echo $msg . '<br>';
include 'form.inc';
} else {
// do somethig with submited values
echo 'You request is stored.';
}
?>