Forum Moderators: coopster
<?
$uname = $_REQUEST['username'];
$pass = $_REQUEST['password'];
$string = $uname . "@" . $pass;
$array = file("filename");
$asize = count($array);
$i = 1;
echo "Search string: " . $string . "<br><br>";
while ($i <= $asize) {
$result = current($array);
if ($result == $string) { echo $result . " <=== MATCH!"; }
else { echo $result."<br>"; }
$result = next($array);
$i++;
}
?>
$uname = $_REQUEST['username'];
$pass = $_REQUEST['password'];
$string = $uname . "@" . $pass;
$array = file("filename");
$match_found = false;
foreach ($array as $line) {
if ($line == $string) { $match_found = true; break; }
}
if($match_found){
echo 'You are signed in!';
} else {
echo 'Incorrect username or password.';
}
file() [php.net]still have the line ending on them. Change this one line:
if ( rtrim($line) == $string) { $match_found = true; break; }
sorry for all the questions guys.. but i'm a real rookie... i've been using php for long time, but only include() just to get links to work... but yesterday i decided to start digging deeper into the world of php... but i'm trying to use google before i post here. but it's hard when you're stuck and have no clue what to look for =)
again guys.. you have been really helpfull sofar =) really happy i found this site.