hey.. another problem 🙁
i have my login script working, but i want to register the session with the username so i can echo the username on other pages..
if($_POST['sublog']) {
$username = $_POST['iuser'];
$password = (md5($_POST['ipass']));
$querylog = mysql_query("SELECT * FROM admins WHERE (user='".$username."' AND pass='".$password."')");
$numrows = mysql_num_rows($querylog);
if(empty($numrows)) {
echo "incorrect input";
exit();
}else{
$_SESSION['username'] = true;
header("Location: index.php");
}
}
my login
and when i want to call the username
$username = $_SESSION['username'];
echo"<div align='center'>".$username."</div>";
is anyone able to figure this out with this much info?