I have a habit of putting session_start at the absolute very top.. just to play it safe..
<?php
session_start();
// your session stuff here..
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> // don't forget your doctype!
<html>
<head>
.. .. . . yadda yadda yadda
I think there is code flow issues here. You are telling page 1 to assign $name to $POST['name'] prior to the post variable being created (same with the others)..If I understand correctly, I think all of this session and post stuff from page 1 should be at the top of page two... as page two is the destination page from your form.. not a reloading of itself..
What I also find confusing is why (in stage 1) are you creating a variable called $name (which is assigned to $POST['name'], only to create a session variabel ($SESSION['name']) and assign it to $name?
Why not simply create and assign your session variable to post (and likewise for address)?
$_SESSION['name'] = $_POST['name'];
$_SESSION['address'] = $_POST['address'];
It saves the 'middle-men' variables ($name and $address) from the equation.. it streamlines things a little.
And on a side note, hopefully you are sanitising your $_POST variables prior to assigning them to session variables.
But as I examine all of this, I think your info (sessions stuff) from page one should be at the top of the next page (if I understand this correctly).. variables cannot be assigned to $POST variables if those POST variables are not yet set... you can test thise for yourself by getting php to output (echo) the variable $SESSION['name'] after your session declarations at the top of the page.. I would not be suprised to see an error..
On a final note, do you have your error reporting enabled?
I would insert at the top of the page (after session_start() is fine):
ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('display_errors', 'On');
this will tell you what problems you are having (but I think this has to be done on localhost, as I understand that remote servers deliberately do not display errors for the sake of protection against revealing these sort of things to potential harmful trouble makers who may otherwise exploit this).
Cheers,
NRG