HTTP_POST_VARS and refreshing page

Is there a way to capture POST values if the refresh button is pressed?

sorry for the low points, all I have
Who is Participating?
How about using this:

  foreach($_POST as $key => $value)
    $_SESSION["posted_".$key] = $value; //the prefix is just to be sure no important variable is overwritten.
Usually the Browser will ask the user wants to resend the POST variables.

If not, then you could store them in a session, and retrieve them from the session later.
I think sessions are the easiest way to do it.
Or if the values aren't so much you could use cookies, but all this relies on the fact that the user accepts cookies (since even Sessions use cookies if not used through the URI).
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

Well with Sessions you can transmit the id with --enable-trans-id through GET or POST links. Having that said that would be using the solution to solve your problem without actually coming up with the solution(or something like that).

I think we need more information before we can make any real suggestions regarding the circumstances surrounding the situation.
zannerAuthor Commented:
attempting to use session variable

this is what i want to accomplish

// top of page


if ($_SESSION["state"] != "true") {
     $_SESSION["state"] = "false";

// assign new value if db query successful

$_SESSION["state"] = "true";

// test if db query not successful

if ($_SESSION["state"] == "true") {
     do stuff
} else {
     do other stuff

this is all done on one page


You don't have to use session_register if you are using the $_SESSION array.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.