I have an edit-form page to edit my website posts. It uses post method to the same page. If the form is compiled correctly shows up a congrats message.
The p
The general outline of the PRG pattern is this:
if ( $_SERVER['REQUEST_METHOD'] == 'POST' )
{
/// do your magic
$_SESSION['error'] = "Thanks for your message!";
// this should be the full URL per spec, but "/yourscript.php" will work
$myurl = ...;
header("Location: $myurl");
header("HTTP/1.1 303 See Other");
die("redirecting");
}
if ( isset($_SESSION['error']) )
{
print "The result of your submission: ".$_SESSION['error'];
unset($_SESSION['error']);
}