|
Posted by rachellara1979 on 10/09/05 17:24
Hi, new to PHP and to this group, so very sorry if this is simple or
has been covered before. Basically want to check that a user and
password (entered in a previous page) only has characters but the
result of this is that it only ever goes to wrong!!! please tell me
why! I cant figure it out and feel so stupid! I even tried with :
if(ereg("[a-z][A-Z][0-9]", $Pword) && ereg("[a-z][A-Z][0-9]", $User)) {
redirection2();
}
else {
redirection();
}
and that also goes to the wrong.php page (which I put in a following
else), that's why I assumed try checking that it equals 1, but still no
good. HELP ME PLEASE!!
<?php
function redirection2() {
header("location: ok.php");
}
function redirection() {
header("location: wrong.html");
}
$User = $_POST["Username"];
$Pword = $_POST["Password"];
if(ereg("([a-z][A-Z][0-9])", $User, $Pword) == 1) {
redirection2();
}
else {
redirection();
}
?>
[Back to original message]
|