PHP Example
Screen shot
Screen shot
Screen shot
PHP Script to use of hidden field and isset() function.

<html>
<head>
</head>
<body>
<table border=\"1\" width=\"100%\">
<tr>
<td width=\"20%\">
<?php
if(isset($_POST[\'btn\']))
echo \"Step 2\";
elseif(isset($_POST[\'btn2\']))
echo \"Step 3\";
else
echo \"Step 1\";
?>
</td>
<td width=\"80%\" rowspan=\"3\">
<?php
if(isset($_POST[\'btn\']))
{
?>
<form name=\"frm\" action=\"\" method=\"post\">
Enter City<input name=\"city\" type=\"text\"><br>
Enter Country<input name=\"country\" type=\"text\"><br>
<input name=\"fname\" type=\"hidden\" value=\"<?php echo $_POST[\'fname\']; ?>\" /><br>
<input name=\"age\" type=\"hidden\" value=\"<?php echo $_POST[\'age\']; ?>\" />
<input name=\"btn2\" type=\"submit\" value=\"submit\">
</form>
<?php
}elseif(isset($_POST[\'btn2\']))
{
echo \"Your Name : \".$_POST[\'fname\'].\"<br>\";
echo \"Your Age : \".$_POST[\'age\'].\"<br>\";
echo \"Your City : \".$_POST[\'city\'].\"<br>\";
echo \"Your Country : \".$_POST[\'country\'].\"<br>\";
}
else
{
?>
<form name=\"frm\" action=\"\" method=\"post\">
Enter Name<input name=\"fname\" type=\"text\"><br>
Enter Age<input name=\"age\" type=\"text\"><br>
<input name=\"btn\" type=\"submit\" value=\"Next\">
</form>
<?php
}
?>
</td>
</tr>
</table>
</body>
</html>

You can download source code here