Hi all,
I want to implement a session based system whereby after a successful login, some fields on a form will be automatically populated with some session record about the user.
This is my code, but its not behaving the way I want ;
<?php
session_start();
$username = $_SESSION['username'];
$firstname = $_SESSION['firstname'];
$surname = $_SESSION['surname'];
require_once("../admin/db.php");
?>
<form action="process.php" method="post" >
<table>
<tr>
<td width="124">Name:</td>
<td colspan="2"><input name=" uname " id=" uname" size="60" value="<?php echo $username; ?>" /></td>
<td colspan="2"> </td>
</tr>
<tr>
<td width="124">Name:</td>
<td colspan="2"><input name=" firstname " id=" firstname " size="60" value="<?php echo $firstname; ?>" /></td>
<td colspan="2"> </td>
</tr>
<tr>
<td width="124">Name:</td>
<td colspan="2"><input name="surname" id=" surname " size="60" value="<?php echo $surname; ?>" /></td>
<td colspan="2"> </td>
</tr>
</table>
</form>
It is only username that gets filed automatically. I however want to fill the firstname and surname too as well.
Your help is much welcome.
Regards,