I am searching for a code that let the username of the account shows in welcome.php
my checklogin.php code is here :
<?php
mysql_connect('localhost', 'root', '');
mysql_select_db('bloodneeded');
$username = $_POST['uname'];
$password = $_POST['pass'];
$sql = "SELECT * FROM welcome WHERE username= '$username' AND password= '$password'";
$result = mysql_query($sql);
if ($result) {
$count = mysql_num_rows($result);
if ($count == 1) {
session_register("uname");
session_register("pass");
header("location:Welcome.php");
} else {
echo "Wrong Username or Password";
}
}
?>
and the welcome.php code is here :
<p id="form1"> Welcome </p>
all i want is to "echo" near welcome the name of the user logged in can ayone please help me ?