I have this login script and here it is
<?php
setcookie("user",$username,time()+(3*86400));
?>
<html>
<body>
<?php
include("colours.inc.php");
?>
<?php //10
//Made by Josh Weissbock
include("jocey.inc.php");
$connection = mysql_connect($host, $user,$password)
or die ("Couldn't connect to server.");
mysql_select_db($database, $connection)
or die ("Couldn't select database."); //20
$result = mysql_query("SELECT * FROM members WHERE username='$_POST[username]'");
$array = mysql_fetch_array($result,MYSQL_ASSOC);
$result2 = mysql_query("select count(*) as num_users FROM members WHERE username = '$_POST[username]'");
$row = mysql_fetch_array($result2,MYSQL_ASSOC);
if ($_POST[username] == "" or $_POST[password] == "")
{
echo "Username or Password is blank"; //30
}
elseif ($row[num_users] < 0)
{
echo "No such username";
}
elseif ($array[usertype] == "outcast")
{
echo "You have been outcasted from Elarune";
}
elseif ($_POST[password] != $array[password]) //40
{
echo "Incorrect password";
}
elseif ($_POST[password] == $array[password])
{
$username = $array[username];
echo "You have been logged in";
echo "<br><a href='home.php'>Go Home</a><br>\n";
}
?>
</body>
</html>
and there are a couple ways to login without passwords, I can not figure out how to stop this can someone please help