I have 3 page, and pass value using $_POST method. The reason not using $_GET method is I don't want user go to the url and change the value and able to pass value. From the beginning for t2 and t3 page:
- t2 and t3 will check if(isset($_POST)) then save to the session.
- When t3.php user click on back button, t3 not passing $_POST data and read session
It is able to work when passing data from t1 to t2 and t2 to t3, but when click on back button from t3 to t2, the browser show "Confirm Form Resubmission". How can I make the page read the session data instead of the $_POST value when user hit the back button?
t1.php
t2.php
session_start();
if(isset($_POST)){
unset($_SESSION['t2']);
$_SESSION['t2']=$_POST;
}else if(isset($_SESSION['t2'])){
}else{
header("Location: http://localhost/my_project/t1.php");
}
?>
value1!
value2 .
t3.php
session_start();
if(isset($_POST)){
unset($_SESSION['t3']);
$_SESSION['t3']=$_POST;
}else if(isset($_SESSION['t3'])){
}else{
header("Location: http://localhost/my_project/t1.php");
}
?>
value1!
value2 .
No comments:
Post a Comment