Login virker ik :(
Indrømmet - det er længe siden jeg rodede med det, men jeg får en fejl:Warning: Supplied argument is not a valid MySQL result resource in D:\web\lunarscape.dk_e2v0pe\hathor\dsf\php\login.php on line 16
Warning: Supplied argument is not a valid MySQL result resource in D:\web\lunarscape.dk_e2v0pe\hathor\dsf\php\login.php on line 22
Warning: Supplied argument is not a valid MySQL result resource in D:\web\lunarscape.dk_e2v0pe\hathor\dsf\php\login.php on line 28
--------------------------------------------------
<?php
session_start();
$db = mysql_connect("mysql.cliche.dk", "lunarscape_dk", "qwit85qw");
mysql_select_db("dsf_users", $db);
if($submit)
{
$pass1 = mysql_query("select pass from dsf_users where nick='$usr'");
$nick1 = mysql_query("select nick from dsf_users where nick='$usr'");
$type1 = mysql_query("select type from dsf_users where nick='$usr'");
while($pass2 = mysql_fetch_array($pass1)) // linie 16
{
$password[] = $pass2[0];
}
while($nick2 = mysql_fetch_array($nick1)) //linie 22
{
$nick[] = $nick2[0];
}
while($type2 = mysql_fetch_array($type1)) // linie 28
{
$type[] = $type2[0];
}
if($pass == $password && $nick == $usr)
{
session_register("$usr");
session_register("$type");
header("location: loggedin.php");
}
else
{
echo "<html><head><link rel=\"stylesheet\" type=\"text/css\" href=\"../css/style.css\"></head><body background=\"../pics/bg1.gif\">";
echo "To log in, enter your username and password in the designated boxes. If you are not yet a registred user, sign up <a href=\"signup.php\">here</a>.";
echo "<br>";
echo "<form action=\"$PHP_SELF\">";
echo "Username:<br><input type=\"text\" name=\"usr\"><br>Password:<br><input type=\"password\" name=\"pass\"><br><br><input type=\"submit\" name=\"submit\" value=\"submit\">";
echo "</form></body></html>";
}
}
else
{
echo "<html><head><link rel=\"stylesheet\" type=\"text/css\" href=\"../css/style.css\"></head><body background=\"../pics/bg1.gif\">";
echo "To log in, enter your username and password in the designated boxes. If you are not yet a registred user, sign up <a href=\"signup.php\">here</a>.";
echo "<br>";
echo "<form action=\"$PHP_SELF\">";
echo "Username:<br><input type=\"text\" name=\"usr\"><br>Password:<br><input type=\"password\" name=\"pass\"><br><br><input type=\"submit\" name=\"submit\" value=\"submit\">";
echo "</form></body></html>";
}
?>
