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
london77
Forum Newbie
Posts: 1 Joined: Wed Mar 18, 2009 4:55 pm
Post
by london77 » Wed Mar 18, 2009 4:58 pm
hii there..
i have created a user login page with php and mysql.
i wanted to show user information after user logged in.
but when i use this code somehow it doesnt work..
<? echo $_SESSION['myusername']; ?>
any idea/help?
thnks in advance..
(note: <?php doesnt work.)
php_east
Forum Contributor
Posts: 453 Joined: Sun Feb 22, 2009 1:31 pm
Location: Far Far East.
Post
by php_east » Wed Mar 18, 2009 5:11 pm
<?php should always work. <? may not work on some setups.
William
Forum Contributor
Posts: 332 Joined: Sat Oct 25, 2003 4:03 am
Location: New York City
Post
by William » Wed Mar 18, 2009 5:17 pm
php_east wrote: <?php should always work. <? may not work on some setups.
I think he's saying he already tried <?php and it doesn't work.
london77 wrote: hii there..
i have created a user login page with php and mysql.
i wanted to show user information after user logged in.
but when i use this code somehow it doesnt work..
<? echo $_SESSION['myusername']; ?>
any idea/help?
thnks in advance..
(note: <?php doesnt work.)
http://www.php.net/session_start
Note: I'd recommend using <?php like php_east said.
php_east
Forum Contributor
Posts: 453 Joined: Sun Feb 22, 2009 1:31 pm
Location: Far Far East.
Post
by php_east » Wed Mar 18, 2009 5:25 pm
William wrote: I think he's saying he already tried <?php and it doesn't work.
o, alright.
@london77
would be helpful if you dump $session and see if your session is there at all.