Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include 'config.php';
- if ($referrer)
- {
- session_register ('referrer');
- $_SESSION[referrer] = $referrer;
- $s_ip = $_SERVER['REMOTE_ADDR'];
- $l_referrer = get_uid ($referrer);
- clickcnt ($l_referrer, $s_ip);
- verirefid ($referrenceid, $l_referrer, 'CLK');
- }
- if ($referrenceid)
- {
- session_register ('referrenceid');
- $_SESSION[referrenceid] = $referrenceid;
- }
- header_g ();
- $country_list = country_list ('' . $f_country_id);
- if (!$act)
- {
- $setctrlfocus = 'f_emailaddress';
- $template->set_filenames (array ('index' => '' . $template_path . '/signup.tpl'));
- $template->assign_vars (array ('SITETITLE' => $site_title, 'SETCTRLFOCUS' => $setctrlfocus, 'COUNTRY_LIST' => $country_list));
- $template->pparse ('index');
- }
- else
- {
- if ($act == 'reg')
- {
- $f_emailaddress = trim ($f_emailaddress);
- $setctrlfocus = '';
- if ($f_emailaddress == '')
- {
- $error .= '<li>Please enter a valid Email!</li>';
- if (!$setctrlfocus)
- {
- $setctrlfocus = 'f_emailaddress';
- }
- }
- else
- {
- if (check_useremail ($f_emailaddress))
- {
- $error .= '<li>Email already used by other user</li>';
- if (!$setctrlfocus)
- {
- $setctrlfocus = 'f_emailaddress';
- }
- }
- if (((!$f_emailaddress OR $f_emailaddress == '') OR !eregi ('' . '^[_\\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\\.)+[a-z]{2,6}$', $f_emailaddress)))
- {
- $error .= '<li>Please enter a valid Email</li>';
- if (!$setctrlfocus)
- {
- $setctrlfocus = 'f_emailaddress';
- }
- }
- }
- if ($f_emailaddress != $f_reemailaddress)
- {
- $error .= '<li>Verify Email Address Mismatched! </li>';
- if (!$setctrlfocus)
- {
- $setctrlfocus = 'f_reemailaddress';
- }
- }
- $f_password = trim ($f_password);
- if ($f_password == '')
- {
- $error .= '<li>Please enter a valid Password!</li>';
- if (!$setctrlfocus)
- {
- $setctrlfocus = 'f_password';
- }
- }
- else
- {
- if ((strlen ($f_password) < 5 OR 20 < strlen ($f_password)))
- {
- $error .= '<li>Password must be between 5 and 20 characters long</li>';
- if (!$setctrlfocus)
- {
- $setctrlfocus = 'f_password';
- }
- }
- }
- if ($f_password != $f_repassword)
- {
- $error .= '<li>Verify password Mismatched! </li>';
- if (!$setctrlfocus)
- {
- $setctrlfocus = 'f_repassword';
- }
- }
- if (($f_emailaddress AND $f_emailaddress == $f_password))
- {
- $error .= '<li>Email Address & password should not be same </li>';
- if (!$setctrlfocus)
- {
- $setctrlfocus = 'f_password';
- }
- }
- $f_fname = trim ($f_fname);
- if ($f_fname == '')
- {
- $error .= '<li>Enter the First Name</li>';
- if (!$setctrlfocus)
- {
- $setctrlfocus = 'f_fname';
- }
- }
- $f_lname = trim ($f_lname);
- if ($f_lname == '')
- {
- $error .= '<li>Enter the Last Name</li>';
- if (!$setctrlfocus)
- {
- $setctrlfocus = 'f_lname';
- }
- }
- $f_address1 = trim ($f_address1);
- if ($f_address1 == '')
- {
- $error .= '<li>Enter the Address</li>';
- if (!$setctrlfocus)
- {
- $setctrlfocus = 'f_address1';
- }
- }
- $f_zip = trim ($f_zip);
- if ($f_state == '')
- {
- $error .= '<li>Enter Zip/Postal code</li>';
- if (!$setctrlfocus)
- {
- $setctrlfocus = 'f_zip';
- }
- }
- $f_city = trim ($f_city);
- if ($f_city == '')
- {
- $error .= '<li>Enter the City</li>';
- if (!$setctrlfocus)
- {
- $setctrlfocus = 'f_city';
- }
- }
- $f_state = trim ($f_state);
- if ($f_state == '')
- {
- $error .= '<li>Enter the State</li>';
- if (!$setctrlfocus)
- {
- $setctrlfocus = 'f_state';
- }
- }
- if (!$f_terms)
- {
- $error .= '<li>You must agree our terms & Conditions for membership </li>';
- if (!$setctrlfocus)
- {
- $setctrlfocus = 'f_terms';
- }
- }
- if (!$error)
- {
- $s_referrer = $_SESSION[referrer];
- if ($s_referrer)
- {
- $s_referrer = get_uid ($s_referrer);
- }
- $s_referrenceid = $_SESSION[referrenceid];
- if ($s_referrenceid)
- {
- if (verirefid ($s_referrenceid, $s_referrer))
- {
- $s_referrertype = 'p';
- }
- else
- {
- $s_referrertype = 'g';
- }
- }
- $s_ip = $_SERVER['REMOTE_ADDR'];
- mt_srand ((double)microtime () * 1000000);
- $maxran = 1000000;
- $check_num = mt_rand (0, $maxran);
- $l_confirm_code = md5 ($check_num);
- $sql = '' . '
- insert into ' . $tb_users . '
- (
- password,
- email,
- fname,
- lname,
- address1,
- address2,
- zip,
- city,
- state,
- country_id,
- phone,
- fax,
- signup_date,
- referrer_id,
- referrer_type,
- ip,
- confirmcode
- )
- values
- (
- \'' . addslashes ($f_password) . '\',
- \'' . addslashes ($f_emailaddress) . '\' ,
- \'' . addslashes ($f_fname) . '\',
- \'' . addslashes ($f_lname) . '\',
- \'' . addslashes ($f_address1) . '\',
- \'' . addslashes ($f_address2) . '\',
- \'' . addslashes ($f_zip) . '\',
- \'' . addslashes ($f_city) . '\',
- \'' . addslashes ($f_state) . ('' . '\',
- \'' . $f_country_id . '\',
- \'') . addslashes ($f_phone) . '\',
- \'' . addslashes ($f_fax) . '\',
- now(),
- \'' . addslashes ($s_referrer) . '\',
- \'' . addslashes ($s_referrertype) . ('' . '\',
- \'' . $s_ip . '\',
- \'' . $l_confirm_code . '\'
- )');
- if (!($res = mysql_query ($sql)))
- {
- exit (mysql_error ());
- (bool)true;
- }
- $finishlink = '' . 'Before login you must activate your registration.
- ' . $base_url . '/activation.php?op=reg&username=' . $f_emailaddress . '&check_num=' . $l_confirm_code;
- $mailbody = readfilecontent ('' . $emailtpl_path . '/tpl_userjoinconfirmation.tpl');
- $mailsubject = '' . 'User Activation Link From ' . $site_title;
- $mail = new Mail ();
- $mail->To ($f_emailaddress);
- $mail->From ('' . $admin_name . ' <' . $admin_mail . '>');
- $mail->ContentType (($settings['mail_format'] == 'h' ? 'text/html' : 'text/plain'));
- $mail->Subject ($mailsubject);
- $mail->Template ($mailbody);
- $mail->Vars (array ('HOME_URL' => $base_url, 'SITE_TITLE' => $site_title, 'FNAME' => $f_fname, 'USERNAME' => $f_emailaddress, 'PASSWORD' => $f_password, 'FINISHLINK' => $finishlink));
- $mail->Send ();
- $msg = 'Confirmation request email was sent to your email address.
- Please click on confirmation link in the email in order to be able
- to use your account';
- $errortemplates = readfilecontent ('' . $template_path . '/error.tpl');
- $errortemplates = str_replace ('{ERROR_MESSAGES}', $msg, $errortemplates);
- $errortemplates = str_replace ('{BASE_URL}', $base_url, $errortemplates);
- $template->set_filenames (array ('helplog' => '' . $template_path . '/blank.tpl'));
- $template->assign_vars (array ('ERROR_MESSAGES' => $errortemplates));
- $template->pparse ('helplog');
- }
- else
- {
- $errortemplates = readfilecontent ('' . $template_path . '/error.tpl');
- $errortemplates = str_replace ('{BASE_URL}', $base_url, $errortemplates);
- $errortemplates = str_replace ('{ERROR_MESSAGES}', $error, $errortemplates);
- $template->set_filenames (array ('index' => '' . $template_path . '/signup.tpl'));
- $template->assign_vars (array ('ERROR_MESSAGES' => $errortemplates, 'SETCTRLFOCUS' => $setctrlfocus, 'SITETITLE' => $site_title, 'F_EMAILADDRESS' => $f_emailaddress, 'F_REEMAILADDRESS' => $f_reemailaddress, 'F_PASSWORD' => $f_password, 'F_REPASSWORD' => $f_repassword, 'F_FNAME' => $f_fname, 'F_LNAME' => $f_lname, 'F_ADDRESS1' => $f_address1, 'F_ADDRESS2' => $f_address2, 'F_ZIP' => $f_zip, 'F_CITY' => $f_city, 'F_STATE' => $f_state, 'COUNTRY_LIST' => $country_list, 'F_FAX' => $f_fax, 'F_PHONE' => $f_phone));
- $template->pparse ('index');
- }
- }
- }
- inter_g ();
- footer ();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement