I know this in old issue but I can't figure out the best practices for dealing with the back button.
I'm writing a web application with lots of data movement between the browser and the backend server. I currently use post and of course when the user bypasses the application navigation and uses the back button both IE and Firefox popup messages asking the user if they want to resend the data.
I tried "get" and aside from all the data being displayed within the URL, IE8 still generates a message.
Additionally I can't really identify when the post causes a message and when it doesn't, since I have test cases posting data where the back button does not cause a message.
My environment is JavaScript, PHP and MySQL.
Any help or pointer to a research location is greatly appreciated.
Edited:
I wrote 3 little pages to test posting a->b->c->a and they don't cause any postdata messages. I don't know why:
A
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>test post A</title>
</head>
<body>
<h1>testPostA.php</h1>
<h3>Came from <?php print (isset($_POST['data'])?$_POST['data']:"NoWhere"); ?></h3>
<form action="testPostB.php" method="post">
<input name="data" type="text" value="from testPostA.php" />
<input type="Submit" value="Submit To: testPostB.php" />
</form>
</body>
</html>
B
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>test post B</title>
</head>
<body>
<h1>testPostB.php</h1>
<h3>Came from <?php print (isset($_POST['data'])?$_POST['data']:"No where"); ?></h3>
<form action="testPostC.php" method="post">
<input name="data" type="text" value="from testPostB.php" />
<input type="Submit" value="Submit To: testPostC.php" />
</form>
</body>
</html>
C
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>test post C</title>
</head>
<body>
<h1>testPostC.php</h1>
<h3>Came from <?php print (isset($_POST['data'])?$_POST['data']:"No where"); ?></h3>
<form action="testPostA.php" method="post">
<input name="data" type="text" value="from testPostC.php" />
<input type="Submit" value="Submit To: testPostA.php" />
</form>
</body>
</html>