Page 1 of 1

echo

Posted: Wed Mar 18, 2009 4:58 pm
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.)

Re: echo

Posted: Wed Mar 18, 2009 5:11 pm
by php_east
<?php should always work. <? may not work on some setups.

Re: echo

Posted: Wed Mar 18, 2009 5:17 pm
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.

Re: echo

Posted: Wed Mar 18, 2009 5:25 pm
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.