Share on Google+Share on Google+

Printing username,email Id using session variable.

In this example you will learn about printing username, email Id using session variable.

Printing User Name, Email Id and Address using session variable

Using $session() function, we can print user name, email id and address of the user. 

session_start (); #session start

$email= "";


$session_email= $_SESSION["email"]; 
$session_name= $_SESSION["name"]; 
$session_address= $_SESSION["address"]; 

echo "Your Email ID is ".$session_email."<br>";
echo "Your Name is ".$session_name."<br>";
echo "Your Address is ".$session_address;

The output of this program will:

Your Email id is

Your Name is Raj

Your Address is Delhi.



Posted on: July 31, 2009 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.