I am trying to figure this out but can't. I want to be able to take $username and echo it in Here :
print "logged in ( I want $username Here ) successfully<br>";
But everything i try i get errors.
<?
require_once "db.php";
if (isset($submit)) // name of submit button
{ $query = "select * from admin where username='$username' and password='$password'";
$result = mysql_query($query) ;
$isAuth = false; //set to false originally
while($row = mysql_fetch_array($result))
{
if($row['username'] === $username)
//above row checks to see if username/password combination exists
{
$isAuth = true;
session_start();
session_register('username');
}
}
if($isAuth)
{
print "logged in successfully<br>";
print "<A href='admin.php'>Go to Admin Panel</a>";
}
else
//if login/pass does not exist
{
print "Wrong username or password";
}
}
?>