////////////////////////////////////////////////////////////////////////////// // // register.php // // This page allows the user to register their email address. User registration // is a 2-step process, the first step of which is covered by the functions in // this file, followed by registration confirmation carried out by activate.php. // // On this page the User enters their email address (showRegForm) which is then // passed to registerEmail which validates the address and then generates a // default password and activation code based on the hash value of the email // address. This is all sent to the email account, pasted into an email template // templates/registrationemail.txt. The user can then validate their registration // by following a link in the email which takes them to the page activate.php. // //////////////////////////////////////////////////////////////////////////////// require("common.inc.php"); connect_db(); // switch on FormName which is a hidden field at the top of this page // (see showRegForm). If we have been called from the register page then // we know that we have already captured the user email address and now // need to process it. If we are called here from any other page then // we show the default form. switch ($_POST['FormName']) { case "Register": registerEmail($_POST['Email']); exit; default: showRegForm(); exit; } //////////////////////////////////////////////////////////////////////////////// // // function showRegForm // Displays the new user registration form // //////////////////////////////////////////////////////////////////////////////// function showRegForm() { $output = "