Session Problems

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nblackwood
Forum Newbie
Posts: 4
Joined: Wed Feb 17, 2010 2:12 am

Session Problems

Post by nblackwood »

I have been trying to get sessions to work with no luck. Here's some code that i'm using for putting into session and session variable retrieval. If anyone can tell me what's wrong or what i didn't do. and yes I am putting session_start(); on each page but with no success. Thanks for any input.

<?php session_start();

$_SESSION["Name"];
$_SESSION["Email"];

?>

Variable Retrieval:

<?php echo $_SESSION["Name"];?>

Please Help.
User avatar
clydoris
Forum Newbie
Posts: 10
Joined: Wed Feb 17, 2010 8:59 pm

Re: Session Problems

Post by clydoris »

i got the same problem too..any help?
User avatar
jthermane24
Forum Newbie
Posts: 16
Joined: Wed Feb 17, 2010 8:15 pm
Location: New Jersey

Re: Session Problems

Post by jthermane24 »

try using single quotes not double quotes
nblackwood
Forum Newbie
Posts: 4
Joined: Wed Feb 17, 2010 2:12 am

Re: Session Problems

Post by nblackwood »

that made no difference
User avatar
Weiry
Forum Contributor
Posts: 323
Joined: Wed Sep 09, 2009 5:55 am
Location: Australia

Re: Session Problems

Post by Weiry »

Are you setting your session variables at all?

Code: Select all

<?php
session_start();
 
$_SESSION['name'] = 'MyName';
$_SESSION['email']   = 'MyEmail';
$_SESSION['time']     = time();
 
print_r($_SESSION);
?>
User avatar
clydoris
Forum Newbie
Posts: 10
Joined: Wed Feb 17, 2010 8:59 pm

Re: Session Problems

Post by clydoris »

oh, that's it..i think i've got it..
Post Reply