include("include/config.php");
include("include/db.php");
session_start();
if(sizeof($_POST) > 0 && $_POST['btn_regpre'] != ''){
$pre_email = $_POST['email'];
$pre_name = $_POST['name'];
}
if(sizeof($_POST) > 0 && $_POST['btn_reg'] != '') { // true if form has been submitted
$msg = "";
/* Select all users with the preference Apples */
$query = "SELECT * FROM leo_clients where email='".$_POST["email"]."'";
$result = MYSQL_QUERY($query);
/* How many of these users are there? */
$number = MYSQL_NUMROWS($result);
if($number>0){
$msg .= "电子邮件 (Email) 已经被他人使用,请重新填写.";
}
$Temail = $_POST["email"];
$Tpassword = $_POST["password"];
$Trealname = $_POST["realname"];
$Tlegalname = $_POST["legalname"];
$Tphone = $_POST["phone"];
$Tcell = $_POST["cell"];
$Taddress = $_POST["address"];
$TPhoneBestTime = $_POST["PhoneBestTime"];
$TCellBestTime = $_POST["CellBestTime"];
$Tzip = $_POST["zip"];
$Tlocation = $_POST["location"];
$Tbusinessmode = $_POST["businessmode"];
$TAim = $_POST["Aim"];
$TMoveInDate = $_POST["MoveInDate"];
$TCondoRooms = $_POST["CondoRooms"];
$TMaxBudget = $_POST["MaxBudget"];
$TJobLetter = $_POST["JobLetter"];
$TCCReport = $_POST["CCReport"];
$TWhen2buy = $_POST["When2buy"];
$TMortgagePA = $_POST["MortgagePA"];
$TPropertyType0 = $_POST["PropertyType"];
if($TPropertyType0){ $TPropertyType = join( '|', $TPropertyType0 ); }
$TLocations0 = $_POST["Locations"];
if($TLocations0){ $TLocations = join( '|', $TLocations0 ); }
$TDistricts0 = $_POST["Districts"];
if($TDistricts0){ $TDistricts=join('|',$TDistricts0); }
$TeAlertST = $_POST["eAlertST"];
$TIntersection = $_POST["Intersection"];
$TNumOfRoom = $_POST["NumOfRoom"];
$TNumOfBathroom = $_POST["NumOfBathroom"];
$TGarageType0 = $_POST["GarageType"];
if($TGarageType0){ $TGarageType = join( '|', $TGarageType0 ); }
$TNumOfParking = $_POST["NumOfParking"];
$TBasementType0 = $_POST["BasementType"];
if($TBasementType0){ $TBasementType = join( '|', $TBasementType0 ); }
if($_POST["MinPrice"]){
$TMinPrice = $_POST["MinPrice"];
}else{
$TMinPrice = 0;
}
if($_POST["MaxPrice"]){
$TMaxPrice = $_POST["MaxPrice"];
}else{
$TMaxPrice = 0;
}
$TNCdowntown = $_POST["NCdowntown"];
$TNCwaterfront = $_POST["NCwaterfront"];
$TNCyonge = $_POST["NCyonge"];
$TNCmarkham = $_POST["NCmarkham"];
$TNCsheppard = $_POST["NCsheppard"];
$TNCstc = $_POST["NCstc"];
$TNCother = $_POST["NCother"];
$Tmessage = $_POST["message"];
$Tsocial_weibo = $_POST["social_weibo"];
$Tsocial_wechat = $_POST["social_wechat"];
$Tsocial_facebook = $_POST["social_facebook"];
if($TAim == "I Want to LEASE a Property"){
$Tmessage = $Tmessage."MoveInDate=>".$TMoveInDate."\n";
$Tmessage = $Tmessage."CondoRooms=>".$TCondoRooms."\n";
$Tmessage = $Tmessage."MaxBudget=>".$TMaxBudget."\n";
$Tmessage = $Tmessage."JobLetter=>".$TJobLetter."\n";
$Tmessage = $Tmessage."CCReport=>".$TCCReport."\n";
}
if($TAim == "I Want to BUY a Property"){
$Tmessage = $Tmessage."When2buy=>".$TWhen2buy."\n";
$Tmessage = $Tmessage."MortgagePA=>".$TMortgagePA."\n";
}
if($msg == ""){
$today = date("Y-m-d");
$query2 = "INSERT INTO leo_clients (email,password,realname,legalname,phone,cell,address,PhoneBestTime,CellBestTime,zip,location,businessmode,Aim,PropertyType,Locations,Districts,Intersection,NumOfRoom,NumOfBathroom,GarageType,NumOfParking,BasementType,MinPrice,MaxPrice,eAlertST,NCdowntown,NCwaterfront,NCyonge,NCmarkham,NCsheppard,NCstc,NCother,message,reg_date,social_weibo,social_wechat,social_facebook)
VALUES ('$Temail','$Tpassword','$Trealname','$Tlegalname','$Tphone','$Tcell','$Taddress','$TPhoneBestTime','$TCellBestTime','$Tzip','$Tlocation','$Tbusinessmode','$TAim','$TPropertyType','$TLocations','$TDistricts','$TIntersection',$TNumOfRoom,$TNumOfBathroom,'$TGarageType',$TNumOfParking,'$TBasementType',$TMinPrice,$TMaxPrice,'$TeAlertST','$NCdowntown','$NCwaterfront','$NCyonge','$NCmarkham','$NCsheppard','$NCstc','$NCother','$Tmessage','$today','$Tsocial_weibo','$Tsocial_wechat','$Tsocial_facebook')";
//print $query2;exit;
$sess_query=$query2;
$query3 = mb_convert_encoding($query2, "utf-8", "gb2312");
$result2 = MYSQL_QUERY($query3) or die(mysql_error());
$id = mysql_insert_id();
$_SESSION['sess_id'] = $id;
//$url = "final.php?u=$Tusername&p=$Tpassword";
$msg = "Thank you $Trealname ! You have successfully registered as a member of www.leozhang.ca ! Thank you ! Please login with your userid and password. ";
$url = "userlogin.php?msg=".$msg;
header ("Location: ".$url);
}
}
?>
注册新会员
include_once("include/newnav.header.inc.php"); ?>
include("include/leo_header.php"); ?>
include_once("include/nav_new.inc.php"); ?> |
include("include/leo_footer.php"); ?>