PRG or Post / Redirect / Get is just a template that you can use to prevent messages from appearing. How you use it in detail (and the article makes only a general proposal) depends on your needs.
Whether you want to flag the success flash message inside a cookie or session or get variable is entirely up to you. The second redirect will not help you, you will find out that if you play with it.
The only important part is that after you receive the POST request, you will be redirected. The user can then move back and forth in the story without requesting to resend the POST data.
The template works and is great. Just two days ago, I did it again, and the weppapp step-by-step installer was much nicer to navigate the browser interface.
About your redirect
This code is incorrect:
header('Location:/login/form.php?success=true');
First of all, you need to have a space after the colon:
header('Location: /login/form.php?success=true');
Then the address must be an absolute URI, it must contain the full URL:
header('Location: http://example.com/login/form.php?success=true');
Next to header() you must provide the body of the message in accordance with the RFC, many so-called "web developers" do not even know:
$url = 'http://example.com/login/form.php?success=true'; header(sprintf('Location: %s', $url)); printf('<a href="%s">Moved</a>.', $url); exit;
Do not forget to go out. Undoubtedly, to pretty much rethink the wheel, instead install the PHP HTTP extension and simply run the following line:
http_redirect('/login/form.php?success=true');
You will find that a great helper is here .
Recall: it is important that you redirect after posting. Everything else, like passing a variable, is entirely up to you how you would like to do this.