I am Getting Error!
Posted: Fri Apr 17, 2009 7:38 am
Listen!.....
Kindly,Rectify this sample code........
This is My PHP Code(Trying to use Session).I am using PHP 5.2.1 version....Actually I am trying to this sample code.But,I am Getting Error.Actually! I planned to using a session in my real time application after success of this sample code.This itself,I am getting Error.
This is one.php
<?php
session_start();
?>
<html>
<form action="second.php" method="post">
Enter the Name:<input type="text" name="name">
Enter the Id:<input type="text" name="id">
<input type="submit">
</form>
</html>
This is second.php
<html>
<form action="three.php" >
<?php
echo $uname=$_POST['name'];
echo $id=$_POST['id'];
$_SESSION["seesionname"]= array("username"=>$uname,"id" =>$id);
?>
<input type="submit">
<form>
</html>
This is three.php
<?php
aSessionData = array();
$aSessionData = $_SESSION["seesionname"];
$loggedUserName=$aSessionData['username'];
$loggedUserId=$aSessionData['id'];
echo $loggedUserName;
echo $loggedUserId;
?>
Thanks1
Kindly,Rectify this sample code........
This is My PHP Code(Trying to use Session).I am using PHP 5.2.1 version....Actually I am trying to this sample code.But,I am Getting Error.Actually! I planned to using a session in my real time application after success of this sample code.This itself,I am getting Error.
This is one.php
<?php
session_start();
?>
<html>
<form action="second.php" method="post">
Enter the Name:<input type="text" name="name">
Enter the Id:<input type="text" name="id">
<input type="submit">
</form>
</html>
This is second.php
<html>
<form action="three.php" >
<?php
echo $uname=$_POST['name'];
echo $id=$_POST['id'];
$_SESSION["seesionname"]= array("username"=>$uname,"id" =>$id);
?>
<input type="submit">
<form>
</html>
This is three.php
<?php
aSessionData = array();
$aSessionData = $_SESSION["seesionname"];
$loggedUserName=$aSessionData['username'];
$loggedUserId=$aSessionData['id'];
echo $loggedUserName;
echo $loggedUserId;
?>
Thanks1