Hello!
I am after a bit of advice please. I am trying to improve the method I have for dealing with invalid submissions, and retaining the $_POST data to repopulate a form when navigated back to it
Currently, I have only done this for <input’s and I know I need to implement the same for <select’s, but thought I would check this method and get any improvements before I do that (there’s tonnes…!)
At the moment, I have the following:
form.php:
[code=php]
all the rest of the form…
<input type=”text” name=”NAME” class=”formwidth” maxlength=”32″ value=”<?php echo $_SESSION[‘supportname’]; ?>” />
this “form.php” submits to my “support.php”, which contains:
[code=php]
$_SESSION[‘supportname’] = htmlentities($_POST[‘NAME’]);
// validation
// if all ok, unset() it
1) Would you suggest not posting to a different page, instead should I submit to the same page?
2) I’d like to display my validation errors, and show the form repopulated beneath it – how can I do that?
3) I’d like to insert a little “red” attention sign to all the failed inputs… is that easy?
Thanks in advance for any advice you can provide