I am very new to the world of PHP . The problem that I am facing is with the use of back button . When I click on the back button from page2 to page1 the options which I had selected on page1 is not getting saved . So I need to select all the data once again in page1 . I am using sessions . The funny part is when I use a text box question on page 1 and submit its value to page 2 and then click on back button on page2 the data is being saved . Please take a look into this code I named this file as 1.php
<?php
session_start();
?>
<html>
<body>
<form action="2.php" method="post">
Name<input type="text" name="name" value="<?php if(isset($_SESSION['name'])) echo $_SESSION['name']; ?>"/>
<input type="submit" value="next"/>
</form>
</body>
</html>
I named this file as 2.php
<?php
session_start();
$name = $_POST['name'];
session_register('name');
?>
<html>
<body>
<form action="1.php" method="post">
<input type="submit" value="back"/>
</form>
</body>
The problem is that I do not know how to implement this on the radio buttons . Could you please help me out Thanks in advance