User: cjordan Date: 2010/03/17 01:09 PM
Modified: /about/members/ send-registration.php
Log: more tweaks
File Changes:
Directory: /about/members/ ==========================
File [modified]: send-registration.php Delta lines: +6 -5 =================================================================== --- about/members/send-registration.php 2010-03-17 18:02:37 UTC (rev 84) +++ about/members/send-registration.php 2010-03-17 18:09:31 UTC (rev 85) @@ -20,12 +20,13 @@ $message = "Einstein Toolkit mainatiners: \n\n".$name." from ".$institution." has submitted a request to register with the Einstein Toolkit. His or her email address is ".$email.". ".$addtolist."\n\n Thanks,\n Einstein Toolkit Registration Bot\n";
/* PHP form validation: the script checks that the Email field contains a valid email address and the Subject field isn't empty. preg_match performs a regular expression match. It's a very powerful PHP function to validate form fields and other strings - see PHP manual for details. */ -if (!preg_match("/\w+([-+.]\w+)*@\w+([-.]\w+)*.\w+([-.]\w+)*/", $email)) { - echo '<h4>Please provide an email address.</h4>'; - echo '<a href="javascript:history.back(1);">Please try again</a>'; -} elseif ($name == '') { +if ($name == '') { echo '<h4>Please fill in your name.</h4>'; - echo '<a href="javascript:history.back(1);">Please try again</a>'; + echo '<br /><a href="javascript:history.back(1);">Try again</a>'; + } + elseif (!preg_match("/\w+([-+.]\w+)*@\w+([-.]\w+)*.\w+([-.]\w+)*/", $email)) { + echo '<h4>Please provide a valid email address.</h4>'; + echo '<br /><a href="javascript:history.back(1);">Try again</a>'; }
/* Sends the mail and outputs the "Thank you" string if the mail is successfully sent, or the error string otherwise. */
commits@lists.einsteintoolkit.org