session_start();
/*echo"
";
print_r($_SERVER);
echo"
";
*/include_once("config.php");
include_once("includes/common.php");
include_once("includes/functions/server_validation.php");
include_once("rateit/config.php");
include(mnminclude.'html1.php');
//for register_step1.php
if(isset($_POST[btnNext]))
{
$errorOnPage1 = "";
$error_code = "";
if($username == "" || $password1 == "" || $password2 == ""){
$errorOnPage1 = "all fields are required";
}elseif (!eregi("^[a-zA-Z0-9_][a-zA-Z0-9_]{2,}$", $username) || trim($username) == ""){
$errorOnPage1 = "Usernames must be at least 3 characters long. They can only contain the characters a-z, A-Z, 0-9, _, and must begin with either a letter, a number, or an underscore. Spaces are not allowed.";
}elseif($password1 != $password2){
$errorOnPage1 = "Your passwords don't match.";
}elseif ((!eregi("^[a-zA-Z1-9_][a-zA-Z0-9_]{4,}$", $password1)) || (trim($password1) =="")){
$errorOnPage1 = "Passwords must be at least 5 characters long. They can only contain the characters a-z, A-Z, 0-9, _, contain no spaces, and cannot start with a zero.";
}else{
$rs = $db->query("select user_id from user where uname = '$username'");
if($db->num_rows($rs) > 0)
{
$errorOnPage1 = "The username $username is unavailable";
}
}
if($errorOnPage1 == ""){
$password = base64_encode($password1);
$step1=1;
}
}
//for register_step2.php
if(isset($_POST[btnDone]))
{
$errorOnPage1 = "";
$error_code = "";
$field_required = "$fname,$lname,$email,$gender,$birthMonth,$birthDay,$birthYear";
$field_description ="your first name.,your last name.,your E-mail.,your gender.,birth month.,birth day.,birth year.";
if($country == 223){
$field_required .= ",$zip";
$field_description .= ",your zip code.";
$fieldNumeric = array($zip);
$fieldNumericDesc = array("zip code: Please enter a 5 digit zip code");
}
$field_required .= ",$code";
$field_description .= ",the letters in the box.";
$fieldRequired = explode(",",$field_required);
$fieldDescription = explode(",",$field_description);
$fieldEmail = array($email);
$fieldConfirm = array($_SESSION['security_code'],$code);
$fieldConfirmDesc = array("confirmed code","letters in the box");
serverside_validation($fieldRequired,$fieldDescription,$fieldEmail,$fieldConfirm,$fieldConfirmDesc,$fieldNumeric,$fieldNumericDesc);
$error_code = $alert;
if($error_code == ""){
if($tos == ""){
$error_code = "You Have to agree our terms and service";
}
}
if($error_code == ""){
$rs = $db->query("select count(*) from user where email = '".$email."'");
if(mysql_result($rs,0,0) > 0){
$error_code = "Account already exists for the e-mail address: '$email'";
}
}
/* will do in user_reg_confirm.php
// creating email account in cpanel
if($error_code == ""){
$email_pin = substr(uniqid(rand(), true),0,5);
$euser = $username.".".$email_pin;
$epass = base64_decode($password);
$result = create_email_account($euser,$epass);
if (!$result){
$errorOnPage1 = "Failed to create mobile/email upload id
Please try back later";
}
$mob_upload_id = $euser;
}*/
// End email account creation
if($error_code == "" && $errorOnPage1 == "") {
$affiliate_id = $_COOKIE["refid"];
if (isset($_SESSION['shopper'])) {
$db->query("UPDATE clickthroughs SET validpayclick = 'yes',ordered = 'yes' WHERE clickthrough_id = '".$_SESSION['shopper']."' LIMIT 1 ");
$clickthrough_id = $_SESSION['shopper'];
}
$confirm_code = md5(uniqid(rand(), true));
$dob = $birthYear.'-'.$birthMonth.'-'.$birthDay;
$image_option_sql = "SELECT max( option_id ) AS mid FROM image_upload_option WHERE account_type =0 and byte_size != ''";
$image_option_rs = $db->query($image_option_sql);
$image_option_rw = mysql_fetch_array($image_option_rs);
$image_option_id = $image_option_rw['mid'];
$video_option_sql = "SELECT max( option_id ) AS mid FROM video_upload_option WHERE account_type = 0 and byte_size != ''";
$video_option_rs = $db->query($video_option_sql);
$video_option_rw = mysql_fetch_array($video_option_rs);
$video_option_id = $video_option_rw['mid'];
$table = "user";
$field = "uname,password,reg_date,fname,lname,email,user_status,acc_type,gender,dob,country,zip,confirm_code,affiliate_id,reg_clickthrough_id,image_upload_option,video_upload_option";
$values = "'$username','$password',UNIX_TIMESTAMP(),'$fname','$lname','$email',0,0,'$gender','$dob',$country,'$zip','$confirm_code','$affiliate_id','$clickthrough_id','$image_option_id','$video_option_id'";
if($newsletter_subscribe == 1){
$field .= ",subscribe_to_newsletter";
$values .= ",'1'";
}else{
$field .= ",subscribe_to_newsletter";
$values .= ",'0'";
}
//echo "
INSERT INTO user ($field) VALUES ($values)";
$db->query("INSERT INTO user ($field) VALUES ($values)");
$u_id = mysql_insert_id($db->link);
//echo "
here:".$u_id;
//$id = $db->insert_id();
//echo "
INSERT INTO account_options (user_id,album_type,thumbnum,bgcolor,album_sort,sendemail,sites_op,forum_op) VALUES (LAST_INSERT_ID(),'1','18','#FFFFFF','ascending','1','1','1')";
$db->query("INSERT INTO account_options (user_id,album_type,thumbnum,bgcolor,album_sort,sendemail,sites_op,forum_op) VALUES ($u_id,'1','18','#FFFFFF','ascending','1','1','1')");
$email_header = "MIME-Version: 1.0\r\n";
$email_header .= "Content-type: text/html; charset=iso-8859-1\r\n";
$email_header .= "From:".ADMIN_EMAIL_ID."\n";
$email_header .= "Reply-To:".ADMIN_EMAIL_ID."\n";
$emailbody = "Dear ".$fname." ".$lname.",
To confirm your Uploadkey Account please click the link below:
"
."$siteurl/user_reg_confirm.php?u=$username&scode=$confirm_code
"
."Regards,
"
."$siteurl
";
@mail($email, "Uploadkey - Your Confirmation Needed", $emailbody, $email_header);
$_SESSION[guest_id] = $u_id ;
$success = 1;
}
}
?>
Upload Key - Register
include("header.php") ?>
if($success == 1 && isset($_SESSION[guest_id])){
?>
}else{
if(!isset($step1) || $errorOnPage1 != "")
{
include_once("regsiter_step1.php");
}
else
{
include_once("regsiter_step2.php");
}
}
?>
|
|
include("footer.php");?>