0) { $_SESSION['user_id']=mysql_result($result,0,"id"); $_SESSION['user_firstname']=mysql_result($result,0,"firstname"); $_SESSION['user_lastname']=mysql_result($result,0,"lastname"); $_SESSION['user_email']=mysql_result($result,0,"email"); $_SESSION['admin']=mysql_result($result,0,"admin"); $exptime = time()+86400; setcookie('user_id',$_SESSION['user_id'],$exptime); echo ""; } else { $action=""; $login_error=(login_error)."

"; } } if ($action=="create") { $firstname=mysql_escape_string($_POST['firstname']); $lastname=mysql_escape_string($_POST['lastname']); $email=mysql_escape_string($_POST['email']); $pword1=mysql_escape_string($_POST['pword1']); $pword2=mysql_escape_string($_POST['pword2']); //Validate email, users and passwords: // validate email $result=VerifyEmail($email); if(!$result[0]) { $email=""; $errors.="
That email address appears to be invalid"; } // check no duplicate users $result=mysql_query(" SELECT * FROM users WHERE email=\"$email\" "); $num=mysql_numrows($result); if ($num>0) { $email=""; $errors.="
That account is already in use"; } //check password length if (strlen($pword1)<6 or strlen($pword2)<6) { $errors.="
Passwords must be at least 6 characters long"; $pword1=""; $pword2=""; } // check passwords match if($pword1 != $pword2) { $errors.="
Passwords do not match"; $pword1=""; $pword2=""; } if (strlen($errors)<1) { //if all valid criteria //create the account mysql_query(" INSERT INTO users (firstname,lastname,email,password) VALUES (\"$firstname\",\"$lastname\",\"$email\", \"$pword1\") "); // And log the brand new user in $_SESSION['user_id']=mysql_insert_id(); $_SESSION['user_firstname']=mysql_result($result,0,"firstname"); $_SESSION['user_lastname']=mysql_result($result,0,"lastname"); $_SESSION['user_email']=mysql_result($result,0,"email"); $exptime = time()+86400; setcookie('user_id',$_SESSION['user_id'],$exptime); // Send Email to the user to confirm account $username=$firstname." ".$lastname; // Send Email to the site contact to inform of new customer $from_address=$email; $to_address=$contact; $subject="Account Created"; $body="This confirms $username ($email) has created a new account "; $headers = "MIME-Version: 1.0\r\n" ."Content-Type: text/plain; charset=utf-8\r\n" ."Content-Transfer-Encoding: 8bit\r\n" ."From: =?UTF-8?B?". base64_encode($site_title) ."?= <$from_address>\r\n" ."X-Mailer: PHP/". phpversion(); mail($to_address, $subject, $body, $headers, "-f $from_address"); // Send Email to the user to confirm account $from_address=$contact; $to_address=$email; $subject="$site_title Account Created"; $body=ACCOUNT_CREATE_EMAIL_TEXT; $headers = "MIME-Version: 1.0\r\n" ."Content-Type: text/plain; charset=utf-8\r\n" ."Content-Transfer-Encoding: 8bit\r\n" ."From: =?UTF-8?B?". base64_encode($site_title) ."?= <$from_address>\r\n" ."X-Mailer: PHP/". phpversion(); mail($to_address, $subject, $body, $headers, "-f $from_address"); echo ""; } else { // inform of error and offer a form to re-login ?>
STEP 1

> first steps
STEP 2

> example
STEP 3

> how to pay

The account could not be created because of the following error(s):



Please try again:

First Name
Last Name
Email Address
Password
Re-Enter Password
0) { // consider the email headers to avoid junk filters $headers = "MIME-Version: 1.0\r\n" ."Content-Type: text/plain; charset=utf-8\r\n" ."Content-Transfer-Encoding: 8bit\r\n" ."From: =?UTF-8?B?". base64_encode($from_name) ."?= <$from_address>\r\n" ."X-Mailer: PHP/". phpversion(); mail($to_address, $subject, $body, $headers, "-f $from_address"); echo "Thank you, an email has been sent to the registered email address

\"\""; } else { echo "Sorry there is no user with that email address in our system

\"\""; } } // closing bracket for if action is "forgotten" ?>
STEP 1

> first steps
STEP 2

> example
STEP 3

> how to pay


add your listing here


First Name
Last Name
Email Address
Password
Re-Enter Password

Email Address
Password

Email Address