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
I am Getting Error!
Moderator: General Moderators
Re: I am Getting Error!
1. Not going to fix your code for you. I'll tell you how, though.
2. You were nice enough to mention you got an error but not nice enough to share it with us.
3. Put your code in [syntax=php][/syntax] tags.
2. You were nice enough to mention you got an error but not nice enough to share it with us.
3. Put your code in [syntax=php][/syntax] tags.