Register a New Customer


Unable to connect to the database server.

" . "

Error code " . mysql_errno() . ": " . mysql_error() . "

"; else { if (!@mysql_select_db($db_name, $db_connect)) echo "

Connection error. Please try again later.

"; else { $errorMessage .= "Inserting new user into db."; echo "Inserting new user into db. $userName $pw $email"; $SQLstring = "INSERT INTO user (username,password,email) VALUES ('$userName','$pw','$email')"; $QueryResult = @mysql_query($SQLstring, $db_connect); } mysql_close($db_connect); } return ($retval); } function displayForm($userName,$email) { global $errorMessage; echo $errorMessage; ?>

User Name:

Email:

Password:

Confirm Password:



"; $errorCount++; } if ($errorCount == 0) $showForm = FALSE; else $showForm = TRUE; } if ($showForm == TRUE) { if ($errorCount > 0) // if there were errors $errorMessage .= "

Please re-enter the form information below.

\n"; displayForm ($userName,$email); } else { // should add password encryption code here // create account in db createNewCustomer($userName, $password, $email); // send confirmation email $SenderAddress = "F8L Exception Bank Customer <$email>"; $Headers = "From: $SenderAddress\nCC:$SenderAddress\n"; $from = "F8L Exception Online Bank"; // sender $subject = "F8L Exception Online Bank New Customer Confirmation"; $message = "You have successfully registered as a new customer for F8L Exception Online Bank. We hope you will enjoy our service and our lack of fees!\n\nThe F8L Exception Online Bank"; // message lines should not exceed 70 characters (PHP rule), so wrap it $message = wordwrap($message, 70); // send mail mail($email,$subject,$message,"From: $from\n"); echo "

You have been set up as a new customer. Welcome to F8L Exception Online Bank!.



\n"; include 'includes/inc_text_menu.php'; } ?>