Following are the two separate pages I have started session in login page and try to save data in session variable and then I printed the data to confirm that the variable holds the data. after that I have used header function to redirect it. when control goes to profile page the st
******************&Login_page&
session_start();
include “dbconnect.php”;
if($_POST[‘Email’]!=””&&$
{
$name = mysql_real_escape_string($_POST[“Email”]);
$userpwd = mysql_real_escape_string($_POST[“Password”]);
$str= “SELECT * FROM books WHERE Email ='”.$name.”‘”.”AND Password = ‘”.$userpwd.”‘”;
$result=mysql_query($str)or die(mysql_error());
if($row = mysql_fetch_array($result))
{
$_SESSION[“0”]=$row[0];
$_SESSION[“1”]=$row[1];
$_SESSION[“2”]=$row[2];
$_SESSION[“3”]=$row[3];
$_SESSION[“4”]=$row[4];
$_SESSION[“5”]=$row[5];
$_SESSION[“6”]=$row[6];
$_SESSION[“7”]=$row[7];
echo $_SESSION[“0″].” “.$_SESSION[“1″].” “.$_SESSION[“2″].” “.$_SESSION[“3″].” “.$_SESSION[“4″].” “.$_SESSION[“5″].” “.$_SESSION[“6″].” “.$_SESSION[“7”];
if(isset($_SESSION[“0”]))
{
session_write_close();
header(“Location:Profile.php”);
}
}
else
{
echo “Invaid user name or password”;
}
}
else
echo “Fields can’t be Null”;
?>
******************&Profile_page&
<?php
session_start()
?>
<h1> Profile</h1>
<table id=”csstable”>
<?php if(!isset($_SESSION[“0″])){echo”not set”;} ?>
<tr><td>Name</td><td><?php echo “”.$_SESSION[“5”]; ?></td></tr>
</table>
</table>
<?php echo $_SERVER[‘SCRIPT_FILENAME’]; echo foot(); ?>