click here"; } else if( sqlite_num_rows($result1) ) $uerr="This username has been reserved by someone else. Please select a different one."; else if( sqlite_num_rows($result3) ) $eerr="Seems like this email address belongs to someone else. Select a different email or click here if you forgot your username or password"; else if (!check_email_mx($_POST[email])) { $eerr="Invalid Email. Please enter a valid email"; } else { $random_password = makeRandomPassword (); $password = md5($random_password); $result1 = sqlite_query("insert into user_authorization values ('$_POST[username]','$random_password', '$password', 0, 1, datetime('now'), datetime('now') )", $link); if ( !$result1 ) { echo "
There has been an error creating your account. Please contact the administrator at adhakal@gmail.com
\n"; sqlite_query("ROLLBACK TRANSACTION", $link); exit; } $result2 = sqlite_query("insert into user_information values ('$_POST[username]', '$_POST[firstname]', '$_POST[lastname]', '$_POST[phone]', '$_POST[email]')", $link); if ( !$result2 ) { echo "
There has been an error creating your account. Please contact the administrator at adhakal@gmail.com
\n"; sqlite_query("ROLLBACK TRANSACTION", $link); exit; } $subject = "Membership at http://students.cs.byu.edu/~adhakal"; $body = "Dear $_POST[firstname] $_POST[lastname],\nThank you for registering at our website http://students.cs.byu.edu/~adhakal\nYour are two steps away from logging in and accessing our exclusive membership area.\nTo activate, click on the following link:\n\thttp://students.cs.byu.edu/~adhakal/activate.php?username=$_POST[username]&code=$password\n\nOnce you activate, you will be able to login with following information:\n\t\tUSERNAME=$_POST[username]\n\t\tPASSWORD=$random_password\nThank you.\n\nSincerely,\nAdministrator(adhakal@gmail.com)\nhttp://students.cs.byu.edu/~adhakal\n\nP.S. This is an automated email. Please do not respond."; if ( mail($_POST[email], $subject, $body) ) { echo "Thank you for registering with us. Your membership information has been emailed to you. Please follow instructions in the email
"; echo "Please click here to go back to the login page"; sqlite_query("COMMIT TRANSACTION", $link); } else { echo "Looks like the CS mail daemon is down. Please try again later."; sqlite_query("ROLLBACK TRANSACTION", $link); } exit; } } } ?>
" method="post"> Required fields are marked with *
First Name: ">
Last Name: ">
Phone Number: ">
*Email: ">
*User Name: ">

Your password will be randomly generated and encrypted before storing into the database.
You will be able to change your password once you login.