display name using sessions
Posted: Thu Jan 29, 2009 2:16 am
Hi guys, I have this piece of code, how do I display the name of the user in the html part
<?php
include("php/connect.php");
session_start();
if (isset($_SESSION['userName'])=="")
{
header("Location:Home.php?msg=Login_Required");
}
?>
<table border="1" width="78%" id="table4" bordercolor="#CCFF33" style="border-style: solid; border-width: 1px; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px">
<tr>
<td bgcolor="#CCFF33" colspan="2">Your PHPSESSID is: <?php echo ......... ?>
</td>
</tr>
</table>
</div></body>
<?php
include("footer.php");
?>
</head>
</html>
<?php
mysql_close();
?>
<?php
include("php/connect.php");
session_start();
if (isset($_SESSION['userName'])=="")
{
header("Location:Home.php?msg=Login_Required");
}
?>
<table border="1" width="78%" id="table4" bordercolor="#CCFF33" style="border-style: solid; border-width: 1px; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px">
<tr>
<td bgcolor="#CCFF33" colspan="2">Your PHPSESSID is: <?php echo ......... ?>
</td>
</tr>
</table>
</div></body>
<?php
include("footer.php");
?>
</head>
</html>
<?php
mysql_close();
?>