Hello, I've created a login page and when the user logs in, it echos their username saying "Welcome Smith5" (for example), please click here to proceed. Then it subsequently kick-starts a session for that user, and I want his username to echo on to the subsequent page, but it won't - any ideas why? It works fine for the first one but not for the next. Here it is (I've cut out the HTML)
passwordverify.php
<?php
session_start();
session_register("usertype");
session_register("username");
session_register("sessionident");
?>
include "common_db.inc";
$linkid = db_connect();
$query = "SELECT * FROM Member WHERE Username = '$_POST[username]'";
$result = mysql_query($query)
or die('MySQL error: '.mysql_error().'<br>Query: '.$query);
$row = mysql_fetch_array($result);
If ($row["Password"] !== $_POST[password]) {
echo ("Incorrect Login. Please try <A HREF=logon.php>again</A>");
}
Else {
$_SESSION[sessionident] = session_id();
$_SESSION[usertype] = $row["usertype"];
$_SESSION[username] = $row["Userid"];
echo ("Welcome $row[Username]! To proceed to the Main Menu - <A HREF=mainhome.php?$_SESSION[sessionident]>Click Here</A>!");
}
?>
Then mainhome.php...
<?php
session_start();
?>
<?php echo $_SESSION[Username]; ?>
Any ideas - I know I've mad eit hard my mixing cases, that it is not that that seems to be the issue here, just cant get what it isnt working. There are no errors, just the username will not display!