View Full Version : Problems with Accessing Variables from different pages

03-07-2007, 08:31 AM

could some1 please help me, I am trying to show the user of my website the information they have entered into my database just after he/she has submitted the information. I am trying to do this by assigning the information they have entered to variables. I have tried the following and its noty working


$contactname = clean( $_POST['contact_name']);
$_SESSION['$contact_name']= $contactname;


<?php session_start(); ?>

<tr><td>Client name
<td><?php $_SESSION['contact_name']; ?></td

page 1 is suppossed to lead to page 2 and display something for the $_SESSION['contact_name'] variable but no text is showing.

could some1 please help me

Thank you

03-07-2007, 08:40 AM
Is session_start() at the top of page 1? session_start() needs to be at the top of every page that you want to use sessions on. And this

$_SESSION['$contact_name']= $contactname;
should be this

$_SESSION['contact_name']= $contactname;
This also won't work

<?php $_SESSION['contact_name']; ?>
You need to either echo the $_SESSION or do something like this