Keep input values after post

Jaim

New Member
I have a website that uses seperate files to process the PHP like the post form is on one page and when a user submits the form, it goes to contact_form.php then when the PHP has processed the form, it will redirect the user with this part of the code:\[code\]// rest of code aboveif($result){ $_SESSION['SUCCESS'] = "Your message was posted"; header("Location: viewtopic.php?id=" . $id . "&mode=view");}else{ $_SESSION['ERROR'] = "Your message could not be posted"; header("Location: viewtopic.php?id=" . $id . "&mode=add");}\[/code\]Since the \[code\]else\[/code\] part would return to the posting page and the values that were submitted would be empty in the input fields, I need them intact when an error has returned...I wouldn't rely on JavaScript validation since users may have them disabled, so I have no idea would be the best method for me to use when returning with errors and the values are intact in the input fields.
 
Back
Top