Re: PHP login script?



session_start() should be first, many other problems:

while ($i < $num) {
$id=mysql_result($result,$i,"id");
$logincheck=mysql_result($result,$i,"login");
$passcheck=mysql_result($result,$i,"pass");
$level=mysql_result($result,$i,"level");
}
This is going to leave you with the vaules of $id, $logincheck,
$passcheck, and $level with the vaules of the last entry in your db,
instead of this you need a db query more like, SELECT * FROM contacts
WHERE login='$login' AND WHERE pass="$pass"

Then check to see if there are any rows, if there are then that
username/password pair is valid.

Also here...
f(($logincheck == "$login") || ($passcheck == "$pass") || ($level !==
"userq") || ($login !== "") || ($pass !== "")){

|| are or's, you want &&, I think, where you say ($login !== "") would
let anyone see the protected content. Those should also be !=

This is a bit of a debacle, you should forget everythign I just said
and take a tutorial....

This one would do the job, http://llimllib.f2o.org/LoginTutorial.html

.