javascript - User Name display as after login -
i want display logging user name. below given code working perfect same page working. want home.php display.
login.php
if($check_user>0) { $_session['user_name']=$username; echo "<script>window.open('home.php','_self')</script>"; }
home page coding <?php echo($_session['username']); ?>
but code undefined index error showing. how can call session username in home page
you have undefined index because setting $_session['user_name']
, try read $_session['username']
. change home page code to: <?php echo($_session['user_name']); ?>
Comments
Post a Comment