Reply to ereg() dilemma

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация