I keep getting a parse error on the following line:
[code=php]while($row = mysql_fetch_array[‘result’])
I downloaded the script (i cant remember where from now) but I have been trying to alter to to get it to work, but I’m not the usuage of
[code=php]mysql_fetch_array[‘result’]
like that before
[code=php]
<?
include”settings.php”;
if (isset($submit)) // name of submit button
{ $query = “select * from logintable where username=’$username’ and password=’$password'”;
echo “nnQuery:”.$query;
$result = mysql_query($query);
echo “nnResult:”.$result;
$isAuth = false; //set to false originally
while($row = mysql_fetch_array[‘result’])
{
echo $row[‘username’];
echo $row[‘password’];
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=’index.php’>Go to Admin Panel</a>”;
}
else
//if login/pass does not exist
{
print “Wrong username or password”;
}
}
?>
Or if anyone can direct me to simple easy to use login script for admin system it would be greatly appreciated,
thanks Neil