echo

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
london77
Forum Newbie
Posts: 1
Joined: Wed Mar 18, 2009 4:55 pm

echo

Post by london77 »

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.)
User avatar
php_east
Forum Contributor
Posts: 453
Joined: Sun Feb 22, 2009 1:31 pm
Location: Far Far East.

Re: echo

Post by php_east »

<?php should always work. <? may not work on some setups.
User avatar
William
Forum Contributor
Posts: 332
Joined: Sat Oct 25, 2003 4:03 am
Location: New York City

Re: echo

Post by William »

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.
User avatar
php_east
Forum Contributor
Posts: 453
Joined: Sun Feb 22, 2009 1:31 pm
Location: Far Far East.

Re: echo

Post by php_east »

William wrote:I think he's saying he already tried <?php and it doesn't work.
o, alright. :drunk:

@london77
would be helpful if you dump $session and see if your session is there at all.
Post Reply