GreyArea
11-07-2003, 04:05 PM
I'm trying to learn php for a site that I'm doing. All I want to do is create a session variable. I've searched the forums and I can create a session var and print it all on one page. However, as soon as I send them to another page the variable no longer prints. I'm passing the session ID in the link so I have no idea why this won't work.
Page A.php prints fine
<?PHP
session_start();
$_SESSION['name'] = 'John';
printf("MY NAME IS %s",$_SESSION['name']);
<a href="B.php?PHPSESSID=<?php echo $PHPSESSID ?>">Home</a>
?>
prints MY NAME IS John w/ a link to page B.php
Page B.php called if link above is pressed passing session id
Hello <?php printf("MY NAME IS %s",$_SESSION['name']);?>
just prints MY NAME IS
Am I missing something here ?????
TIA
Page A.php prints fine
<?PHP
session_start();
$_SESSION['name'] = 'John';
printf("MY NAME IS %s",$_SESSION['name']);
<a href="B.php?PHPSESSID=<?php echo $PHPSESSID ?>">Home</a>
?>
prints MY NAME IS John w/ a link to page B.php
Page B.php called if link above is pressed passing session id
Hello <?php printf("MY NAME IS %s",$_SESSION['name']);?>
just prints MY NAME IS
Am I missing something here ?????
TIA