// redirect to new register
header("Location: /member_register/");die;
///////////////////////////////////////
if ($mid) {
$paylink = array(
"https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=sales%40rightbiz%2eco.uk&item_name=RightBiz%20Annual%20Membership%20[{$mid}]&item_number={$mid}&amount=9%2e95&page_style=Rightbiz&no_shipping=1&return=http%3a%2f%2fwww%2erightbiz%2eco%2euk%2fregister%2fpaid%2ehtml&cancel_return=http%3a%2f%2fwww%2erightbiz%2eco%2euk&no_note=1¤cy_code=GBP&lc=GB&bn=PP%2dBuyNowBF&charset=UTF%2d8",
"https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=sales%40rightbiz%2eco.uk&item_name=RightBiz%20Annual%20Membership%20[{$mid}]&item_number={$mid}&amount=9%2e95&page_style=Rightbiz&no_shipping=1&return=http%3a%2f%2fwww%2erightbiz%2eco%2euk%2fregister%2fpaid%2ehtml&cancel_return=http%3a%2f%2fwww%2erightbiz%2eco%2euk&no_note=1¤cy_code=GBP&lc=GB&bn=PP%2dBuyNowBF&charset=UTF%2d8",
);
$paypal = $paylink[rand(0,1)];
echo "";
echo "RightBiz.co.uk
Forwarding to secure payment, please wait...
or click here to skip this page and continue with secure payment";
die;
}
if (!$title || !$email_address || !$cemail || !$f_name || !$l_name || !$tel || !$pass || !$cpass || !$add1 || !$town || !$county || !$postcode) {
$error = "* All fields must be completed.."; }
if ($title == "Mr") {$Mr = "selected";}
if ($title == "Mrs") {$Mrs = "selected";}
if ($title == "Miss") {$Miss = "selected";}
if ($title == "Ms") {$Ms = "selected";};
if ($title == "Dr") {$Dr = "selected";}
if (!$error) {
// this makes sure both emails entered match
if ($_POST['email_address'] != $_POST['cemail']) {
$error = "
Your email did not match, please try again..
Please ensure that both the email address entries are the same
"; }
}
if (!$error) {
// this makes sure both passwords entered match
if ($_POST['pass'] != $_POST['cpass']) {
$error = "
Your Password did not match, please try again..
Please ensure that both the password entries are the same
";}
}
if (!$error) {
include_once '../db.php';
$newpass = strtolower($pass);
$sql = mysql_query("SELECT * FROM `buy_members` WHERE `email`='".addslashes($email_address)."' LIMIT 1");
while ($row = mysql_fetch_array($sql)) {
foreach($row AS $key => $val){ $$key = stripslashes( $val ); }
if ($id) { $mid = $id; $update = @mysql_query("UPDATE `buy_members` SET `pass`='".addslashes($newpass)."' WHERE `email`='".addslashes($email_address)."' LIMIT 1"); }
include 'tpl_done.html'; die;
}
}
if ((!$error) && (!$id)) {
$makekey = createRandomPassword(); $date = time(); $pass = strtolower($pass); $ref = $_COOKIE['rightbiz-ref'];
$f = @mysql_query("INSERT INTO `buy_members` VALUES ('' ,'".addslashes($title)."','".addslashes($f_name)."','".addslashes($l_name)."', '','".addslashes($add1)."','".addslashes($add2)."','".addslashes($town)."','".addslashes($county)."','".addslashes($postcode)."','".addslashes($tel)."', '".addslashes($email_address)."', '".addslashes($pass)."', '".addslashes($date)."' , '".addslashes($ref)."', '','".addslashes($makekey)."','0','1','');") or die(mysql_error());
$mid = @mysql_insert_id();
@mail("$email_address","Re: RightBiz Buyer Account","Dear ".ucwords($f_name).", \n\nRe: RightBiz Buyers Account\n\nThank you for registering with RightBiz.co.uk\n\nYour login details are below: \n\nLogin Email: $email_address \nLogin Password: $pass \n\nYour can login from the address below:\n\n//www.rightbiz.co.uk/login/ \n\nThis is an automated email please do not reply to this email.\n\nPlease keep these details safe you will need them each time you login.\n\nKind Regards,\nRightBiz Support\n\nConfidentiality Statement:\nThis e-mail may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorised agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately.","From: RightBiz UK ");
$hour = time() + 3592000;
$type="buyer";
$website=".rightbiz.co.uk";
setcookie("buy_ID_my_site", $email_address, $hour, "/", $website);
setcookie("buy_my_site", $pass, $hour, "/", $website);
setcookie("buy_my_siteactive", $active, $hour, "/", $website);
setcookie("login_type", $type, $hour, "/", $website);
include 'tpl_done.html';
} else {
$tplbody = file_get_contents("tpl_register.html");
$header = file_get_contents("../header2.html");
$footer = file_get_contents("../footer.html");
$sidead = file_get_contents("../adside3.html");
$tplbody = str_replace("{header}", $header, $tplbody);
$tplbody = str_replace("{footer}", $footer, $tplbody);
$tplbody = str_replace("{sidead}", $sidead, $tplbody);
$tplbody = str_replace("{error}", $error, $tplbody);
$tplbody = str_replace("{Mr}", $Mr, $tplbody);
$tplbody = str_replace("{Miss}", $Miss, $tplbody);
$tplbody = str_replace("{Mrs}", $Mrs, $tplbody);
$tplbody = str_replace("{Ms}", $Ms, $tplbody);
$tplbody = str_replace("{Dr}", $Dr, $tplbody);
$tplbody = str_replace("{f_name}", $f_name, $tplbody);
$tplbody = str_replace("{l_name}", $l_name, $tplbody);
$tplbody = str_replace("{add1}", $add1, $tplbody);
$tplbody = str_replace("{add2}", $add2, $tplbody);
$tplbody = str_replace("{town}", $town, $tplbody);
$tplbody = str_replace("{county}", $county, $tplbody);
$tplbody = str_replace("{contact_name}", $contact_name, $tplbody);
$tplbody = str_replace("{tel}", $tel, $tplbody);
$tplbody = str_replace("{email_address}", $email_address, $tplbody);
$tplbody = str_replace("{cemail}", $cemail, $tplbody);
$tplbody = str_replace("{pass}", $pass, $tplbody);
$tplbody = str_replace("{cpass", $cpass, $tplbody);
$tplbody = str_replace("{address}", $address, $tplbody);
$tplbody = str_replace("{postcode}", $postcode, $tplbody);
$outputline = split("\n",$tplbody); foreach ($outputline as $line) {
if (trim($line)) { echo trim($line); echo " "; } }
}
function createRandomPassword() {
$chars = "abcdefghijkmnopqrstuvwxyz023456789";
srand((double)microtime()*1000000);
$i = 0;$pass = '' ; while ($i <= 7) {
$num = rand() % 33;
$tmp = substr($chars, $num, 1);
$pass = $pass . $tmp;
$i++;
}
return $pass;
}
?>