Home Tutorial Php Examples Printing username,email Id using session variable.

 
 

Printing username,email Id using session variable.
Posted on: July 31, 2009 at 12:00 AM
Advertisement
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. 

<?php
session_start (); #session start

$email= "raj@rediffmail.com";
$name="Raj";
$address="Delhi";

$_SESSION["email"]=$email;
$_SESSION["name"]=$name;
$_SESSION["address"]=$address;

$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  raj@rediffmail.com

Your Name is Raj

Your Address is Delhi.

Advertisement

Related Tags for Printing username,email Id using session variable.:


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.

Posted on: July 31, 2009

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com