Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Username display after logging

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Username display after logging

Postby simbu » Thu Nov 22, 2012 3:54 am

Hello,

I want to display the username after the user logging.

Here is the code part which i used but i am getting error like undefined index : name


<?php

session_start();
$s_name=$_SESSION['name'];
?>
HELLO <?php echo $s_name; ?>
simbu
New php-forum User
New php-forum User
 
Posts: 3
Joined: Tue Nov 20, 2012 10:59 pm

Re: Username display after logging

Postby seandisanti » Fri Nov 23, 2012 2:25 pm

Session variables are cool, but they're not magic, you still have to put a value in to get one out. here's a short video on working with sessions. http://jream.com/learning/videos/php-ba ... e-security
seandisanti
php-forum Fan User
php-forum Fan User
 
Posts: 838
Joined: Mon Oct 01, 2012 12:32 pm


Return to PHP coding => General

Who is online

Users browsing this forum: Google [Bot], Google Feedfetcher and 9 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.