<?php
session_start();
session_register("username2");
$username2 = "$username";
$password2 = "$userpass";
$file = "fileblah";
$userPattern = "([)($username2)(])";
$passwordPattern = "(PASSWORD=)($password2)";
if(!($text = @file( $file, "r" ))) {
echo "ERROR OPENING FILE";
} //End if
else {
for ($i = 0; $i < count($text); $i++) {
(ereg($userPattern, $text[$i], $match)) {
for ($j = 0; $j < 16; $j++) {
if (ereg($passwordPattern, $text[$i + $j], $match)) {
echo "<META HTTP-EQUIV=\"refresh\" content=\"1;
URL=url\">";
} //End if
} //End for
} //End if
} //End for
} //End Else
?>
Ok ive gotten that far with alot of help, now im trying to make it so if they enter the wrong stuff, it will say wrong blah blah, remove the session and send them back to another page.
Anybody know how to do it? im guessing a elseif statement but not sure elseif what and where to put