This is a discussion on newbie on IF: Why does this not work? within the PHP Language forums, part of the PHP Programming Forums category; Hi everyone, Please help. Why doesn't this work? If email1=email2 and be a email address (via regex) then ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi everyone,
Please help. Why doesn't this work? If email1=email2 and be a email address (via regex) then goto "enter_dob.php". If not or not then goto reenter_email.php. Thanks, Raj <?php if (empty($_SESSION['site_name'])) { ob_end_clean(); header("Location: start.php"); } if (empty($_SESSION['site_logo_location'])) { ob_end_clean(); header("Location: start.php"); } if (empty($_SESSION['site_admin_email'])) { ob_end_clean(); header("Location: start.php"); } $_SESSION['email']=$_POST['email1']; $pattern="(\w+\.)*\w+@(\w+\.)+[A-Za-z]+"; if (!preg_match($pattern, $_SESSION['email'])) { ob_end_clean(); header("Location: reenter_email.php"); } if ($_POST['email1']==$_POST['email2']) { ob_end_clean(); header("Location: enter_dob.php"); } else { ob_end_clean(); header("Location: reenter_email.php"); } ?> |
|
|||
|
On Sat, 26 Jun 2004 18:37:03 +0100, Raj <raj@nospam.com> wrote:
>Hi everyone, > >Please help. > >Why doesn't this work? > >If email1=email2 and be a email address (via regex) then goto >"enter_dob.php". If not or not then goto reenter_email.php. > >Thanks, > >Raj > ><?php >if (empty($_SESSION['site_name'])) >{ > ob_end_clean(); > header("Location: start.php"); >} > >if (empty($_SESSION['site_logo_location'])) >{ > ob_end_clean(); > header("Location: start.php"); >} > >if (empty($_SESSION['site_admin_email'])) >{ > ob_end_clean(); > header("Location: start.php"); >} > >$_SESSION['email']=$_POST['email1']; > >$pattern="(\w+\.)*\w+@(\w+\.)+[A-Za-z]+"; >if (!preg_match($pattern, $_SESSION['email'])) >{ > ob_end_clean(); > header("Location: reenter_email.php"); >} > >if ($_POST['email1']==$_POST['email2']) >{ > ob_end_clean(); > header("Location: enter_dob.php"); >} >else >{ > ob_end_clean(); > header("Location: reenter_email.php"); >} >?> I mean it goes to "enter_dob.php" whatever I input. Raj |
|
|||
|
In article <06crd0l4okjrevqlml8u0t6evtbr7o2adt@4ax.com>, Raj wrote:
> Why doesn't this work? > > If email1=email2 and be a email address (via regex) then goto > "enter_dob.php". If not or not then goto reenter_email.php. where is session_start(); ? > $pattern="(\w+\.)*\w+@(\w+\.)+[A-Za-z]+"; > if (!preg_match($pattern, $_SESSION['email'])) That regular expression is useless. If you want it to be compliant with rfc822 it should more like the one at http://www.ex-parrot.com/%7Epdw/Mail...2-Address.html -- Tim Van Wassenhove <http://home.mysth.be/~timvw> |
|
|||
|
On 26 Jun 2004 20:53:27 GMT, Tim Van Wassenhove <euki@pi.be> wrote:
>In article <06crd0l4okjrevqlml8u0t6evtbr7o2adt@4ax.com>, Raj wrote: >> Why doesn't this work? >> >> If email1=email2 and be a email address (via regex) then goto >> "enter_dob.php". If not or not then goto reenter_email.php. > >where is session_start(); ? > >> $pattern="(\w+\.)*\w+@(\w+\.)+[A-Za-z]+"; >> if (!preg_match($pattern, $_SESSION['email'])) > >That regular expression is useless. >If you want it to be compliant with rfc822 it should more like the one >at http://www.ex-parrot.com/%7Epdw/Mail...2-Address.html Can you use that expression in a sentence? Heh. -- gburnore@databasix dot com --------------------------------------------------------------------------- How you look depends on where you go. --------------------------------------------------------------------------- Gary L. Burnore | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³ | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³ DataBasix | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³ | ÝÛ³ 3 4 1 4 2 ݳ޳ 6 9 0 6 9 ÝÛ³ Black Helicopter Repair Svcs Division | Official Proof of Purchase ================================================== ========================= Want one? GET one! http://www.databasix.com ================================================== ========================= |
![]() |
| Thread Tools | |
| Display Modes | |
|
|