I am Getting Error!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Vinayagam
Forum Newbie
Posts: 2
Joined: Thu Apr 16, 2009 12:21 am

I am Getting Error!

Post by Vinayagam »

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
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: I am Getting Error!

Post by requinix »

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.
Post Reply