i have a notepad that i made into a database.
i want to know if a username and a password are valid combination.
but if i run it, the 10th entry, for example, gives 10 different outputs until it finds the perfect match.
suggestions would be nice.
<?php
$user=$_POST['user'];
$pass=$_POST['pass'];
$files= file("fileone.txt");
$num = count($files);
for($i=0;$i<$num;$i++)
{
$arrs=explode(",",$files[$i]);
if($user==$arrs[0])
{
//echo "Welcome " . $user;
if($pass==$arrs[1])
{
echo "Welcome " . $user ."!";
}
}
else
{
echo "Incorrect Name and Password Combination.";
}
}
?>