
Baiscally i have a php script that gets info from the url and verifys it with the mysql like for example:
http://mydomain.info/login.php?username=test&password=123
Then the php script would grab "username=test" and "password=123" and verify them with the database and if correct it will echo "11" if username is wrong then it echos "0", if password is wrong then it echos "01"
so if the database is:
bob pass1
jill pass2
dave pass3
then the php script works with the first entry "bob pass1" but the other users it just echos "0"
Here is the php script(maybe a bit messy as im not all that good with php)
- Code: Select all
<?php
// Include database connection settings
include('config.inc');
$query="SELECT * FROM login";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
$f1=mysql_result($result,"username");
$f2=mysql_result($result,"password");
$user = addslashes($_GET['username']);
$pass = addslashes($_GET['password']);
if ($user == $f1)
{
echo("1");
}
else
{
echo("0");
exit;
}
if ($pass == $f2)
{
echo("1");
}
else
{
echo("0");
exit;
}
?>
How would i get it to work with all entrys in the database and not just the first 1 ?
Thanks for any help


