User: cjordan Date: 2010/03/17 12:33 PM
Modified: /about/members/ send-registration.php
Log: it does! now for some improvements.
File Changes:
Directory: /about/members/ ==========================
File [modified]: send-registration.php Delta lines: +21 -13 =================================================================== --- about/members/send-registration.php 2010-03-17 17:21:24 UTC (rev 80) +++ about/members/send-registration.php 2010-03-17 17:33:15 UTC (rev 81) @@ -1,6 +1,9 @@ <?php $title='Sending registration...'; -include_once($_SERVER['DOCUMENT_ROOT'].'/global/header.php'); +include_once($_SERVER['DOCUMENT_ROOT'].'/global/header.php'); ?>
+<br /><br /> + +<?php /* All form fields are automatically passed to the PHP script through the array $HTTP_POST_VARS. */ $name = $HTTP_POST_VARS['name']; $email = $HTTP_POST_VARS['email']; @@ -8,28 +11,33 @@ $list = $HTTP_POST_VARS['list'];
if ($list=='yes') { -$addtolist = 'Add this person to the users mailing list.'; +$addtolist = 'Please add this person to the ET users mailing list.'; } else { -$addtolist = 'Do not add this person to the users mailing list.'; +$addtolist = 'Do not add this person to the ET users mailing list.'; }
-$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; +$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);'>Back</a>"; -} elseif ($name == "") { - echo "<h4>Please fill in your name.</h4>"; - echo "<a href='javascript:history.back(1);'>Back</a>"; + echo '<h4>Please provide an email address.</h4>'; + echo '<a href="javascript:history.back(1);">Please try again</a>'; +} elseif ($name == '') { + echo '<h4>Please fill in your name.</h4>'; + echo '<a href="javascript:history.back(1);">Please try again</a>'; }
/* Sends the mail and outputs the "Thank you" string if the mail is successfully sent, or the error string otherwise. */ -elseif (mail("maintainers@einsteintoolkit.org","New Einstein Toolkit registration received",$message)) { - echo "<h4>Thank you for registering!</h4>"; +elseif (mail('maintainers@einsteintoolkit.org','New Einstein Toolkit registration received',$message,'From: RegistrationBot@einsteintoolkit.org')) { + echo '<h4>Registration successfully sent. Thank you for registering!</h4>'; + echo '<a href="/">Go back to try again?</a>'; } else { - echo "<h4>There was a problem registering.</h4>"; + echo '<h4>Unfortunately, there was a problem registering.</h4>'; + echo '<a href="javascript:history.back(1);">Go back to try again?</a>'; } +?>
-include_once($_SERVER['DOCUMENT_ROOT'].'/global/footer.php');?> \ No newline at end of file +<br /><br /> + +<?php include_once($_SERVER['DOCUMENT_ROOT'].'/global/footer.php');?> \ No newline at end of file
commits@lists.einsteintoolkit.org