include("inc/header.php");
if ($_POST['cmd'] == "add") {
// check fields
$message = "";
if ($_POST['DBusername'] == "") { $message .= "You forgot to enter a username.
"; } else { $username = $_POST['DBusername']; $result = sql("S", "users", "`username`='$username'", "1", "", ""); $num = @mysql_num_rows($result); if ($num > 0) { $message .= "The username is already in use, Please select another.
"; } }
if ($_POST['password1'] != $_POST['password2']) { $message .= "Your passwords do not match.
"; } else { $_POST['DBpassword'] = $_POST['password1']; }
if ($_POST['email1'] != $_POST['email2']) { $message .= "Your email addresses do not match.
"; } else { $_POST['DBemailREQ'] = $_POST['email1']; }
if ($_POST['DBfirstnameREQ'] == "") { $message .= "You forgot to enter your first name.
"; }
if ($_POST['DBsurnameREQ'] == "") { $message .= "You forgot to enter your surname.
"; }
if ($_POST['DBaddress1REQ'] == "") { $message .= "You forgot to enter your address line 1.
"; }
if ($_POST['DBtownREQ'] == "") { $message .= "You forgot to enter your postal town.
"; }
if ($_POST['DBpostcodeREQ'] == "") { $message .= "You forgot to enter your post code/area code.
"; } else { strtoupper($_POST['DBpostcodeREQ']); }
if ($_POST['DBphone1REQ'] == "") { $message .= "You forgot to enter your phone number.
"; }
if ($_POST['DBpassword'] == "") { $message .= "You forgot to enter your password.
"; }
if ($_POST['DBemailREQ'] == "") { $message .= "You forgot to enter your email address.
"; }
if ($message == "") {
session_start();
// add to db
$query = checkpost($_POST, "INSERT");
$result = sql("INS", "users", $query, "", "", "");
if (!$result) { } else {
// send emails
$to = $_POST['email1'];
$subject = $_POST['DBfirstnameREQ'] . ", Thanks for Registering with Jivili";
$message = '
| Registration |
|
Login Please use the form below to sign in. If you are having problems then please email us
|
| Registration |
Registering is easy, just fill in the form below and press register. We store your details so you dont have to do it again, but dont worry, we never
pass your details onto other companies. (* = Required Field)
Confidentiality Promise and Data Protection - no email addresses or personal data will ever be shared with third parties unless permission is given to do so. |
||||||||||||||||||||||||||||||||||||||