0){ // receipt is in access table $receipt_in_db_1=true; if($_REQUEST['cemail']!=""){ // setting the e-mail of this receipt entry to the variable to autofill the form $data123=mysql_fetch_assoc($datax); $receipt_entry_email=$data123['email']; } }else{ // receipt is not yet in access table $receipt_in_db_1=false; $notice="Important! The product purchased is undergoing automated database integration. Please wait 2-3 minutes for the process to complete, then click here to reload this page. If the integration message is still displayed, please wait a few minutes longer then reload this page again.

If necessary, you can continue the registration/login process without waiting for the integration to complete but you will not automatically receive update notification and you will not be taken directly to the download page after registration. Should that occur, you will be able to locate the download page within the members area where you will also be able to register for update notifications."; } }else{ // if not from clickbank // if receipt & email is set - set receipt_entry_email if(isset($_REQUEST['cbreceipt']) && $_REQUEST['cbreceipt']!="" && isset($_REQUEST['cemail']) && $_REQUEST['cemail']!=""){ // search for receipt entry $query="SELECT `id`,`email` FROM `".$config['db_access']."` WHERE `code`='".indb($_REQUEST['cbreceipt'])."' LIMIT 1;"; $datax=mysql_query($query); me(mysql_error()); if(mysql_error()!="") savelog("access/logs/register_members.txt","Mysql search for access entry by receipt=".$cb_receipt." error: ".mysql_error()); if(mysql_num_rows($datax)>0){ // setting the e-mail of this receipt entry to the variable to autofill the form $data123=mysql_fetch_assoc($datax); $receipt_entry_email=$data123['email']; } } } if(isset($_REQUEST['cemail']) && $_REQUEST['cemail']!=""){ // checking if user is already a member $query="SELECT `id` FROM `".$config['db_members']."` WHERE `email`='".indb($_REQUEST['cemail'])."' LIMIT 1;"; $datax=mysql_query($query); me(mysql_error()); if(mysql_error()!="") savelog("access/logs/register_members.txt","Mysql search for user by email=".$_REQUEST['cemail']." error: ".mysql_error()); if(mysql_num_rows($datax)>0){ $already_a_member=true; }else{ $already_a_member=false; } } // check if receipt exists while registration/login and setting flag if(isset($_POST['receipt']) && isset($_POST['email']) && isset($_POST['password'])){ // search for Receipt(s) in Access table. THIS QUERY IS USED BELOW SEVERAL TIMES, BE CAREFUL WITH CHANGES!!! $query="SELECT `id`,`code`,`pp`,`status`,`product`,`bid`,`email` FROM `".$config['db_access']."` WHERE `code`='".indb($_POST['receipt'])."' AND `status`='1';"; $datax_receipts=mysql_query($query); me(mysql_error()); if(mysql_error()!="") savelog("access/logs/register_members.txt","Mysql search for receipt error: ".mysql_error()); // check if receipt(s) exists if(mysql_num_rows($datax_receipts)>0){ // yes it does exist! $receipt_in_db_2=true; }else{ // no it doesn't exist! $receipt_in_db_2=false; } } //// REGISTER or LOGIN to Account + send welcome e-mail for new user //// // check if receipt, e-mail and password is set: launch registration/login process if(isset($_POST['receipt']) && isset($_POST['email']) && isset($_POST['password'])){ // check if this user is trying to login/register with the same e-mail that is set in access entry of this receipt(s) // if e-mail is empty or wrong in access entry - it means it is okay and the entry would be updated with user's e-mail $email_is_same=true; // true means everything is okay while($data123=mysql_fetch_assoc($datax_receipts)){ if(strtolower($data123['email'])!=strtolower($_POST['email']) && isemail($data123['email'])){ $email_is_same=false; $email_is_same_value=$data123['email']; } } // check if this is the registration process and necessary fields are set up, if this is login process // please, use account information instead and check his login/pass if($_POST['receipt']!="" && strlen($_POST['fname'])>1 && strlen($_POST['lname'])>1 && strlen($_POST['email'])>5 && isset($_POST['password']) && isset($_POST['password2'])){ // check if e-mail format is correct if(isemail($_POST['email'])){ // check if e-mail is the same by flag if($email_is_same){ // check if passwords match with each other if($_POST['password']==$_POST['password2']){ // check if password isn't too short if($_POST['password']==$_POST['password2']){ // POST into variables $email=strtolower($_POST['email']); $password=$_POST['password']; $password2=$_POST['password2']; $fname=ucwords($_POST['fname']); $lname=ucwords($_POST['lname']); $phone=$_POST['phone']; $address1=$_POST['address1']; $address2=$_POST['address2']; $zip=$_POST['zip']; $city=ucwords($_POST['city']); $state=strtoupper($_POST['state']); $country=ucwords($_POST['country']); $cbid=strtolower($_POST['cbid']); $receipt=strtoupper($_POST['receipt']); // full name $fullname=$fname." ".$lname; // check if e-mail is already registered as a member $query="SELECT `id` FROM `".$config['db_members']."` WHERE `email`='".indb($email)."' LIMIT 1;"; $datax=mysql_query($query); me(mysql_error()); if(mysql_error()!="") savelog("access/logs/register_members.txt","Mysql search for user by email=".$email." error: ".mysql_error()); if(mysql_num_rows($datax)>0){ // User already exists, we should not do anything else... $error="This e-mail address is already registered - please use the Log In form.

If you do not remember your password then you can use the Password Recovery function."; $logged_in=false; }else{ // User does not exist, we register him and send the e-mail notification $query="INSERT INTO `".$config['db_members']."`(`id`,`email`,`password`,`name`,`fname`,`lname`,`telephone`,`zipcode`,`address1`,`address2`,`city`,`state`,`country`,`lastip`,`lastlogin`,`created`,`flag`) VALUES('', '".indb($email)."', '".indb(md5(md5($password)))."', '".indb($fullname)."', '".indb($fname)."', '".indb($lname)."', '".indb($telephone)."', '".indb($zip)."', '".indb($address1)."', '".indb($address2)."', '".indb($city)."', '".indb($state)."', '".indb($country)."', '".indb($_SERVER['REMOTE_ADDR'])."', '', NOW(), 'register' );"; mysql_query($query); me(mysql_error()); if(mysql_error()!=""){ savelog("access/logs/register_members.txt","Mysql insert new user with email=".$email." error: ".mysql_error()); $error="An unknown error occurred. Please contact the support team - http://forex-megadroid.com/support/"; $logged_in=false; }else{ // User has been registered! // Send Welcome e-mail $subject = $config['members']['welcome_subject']; $message = $config['members']['welcome_message']; $message = str_replace("%USER_EMAIL%",$email,$message); // %USER_EMAIL% $message = str_replace("%USER_PASSWORD%",$password,$message); // %USER_PASSWORD% $message = str_replace("%USER_FIRSTNAME%",$fname,$message); // %USER_FIRSTNAME% if(!send_email($email, $subject, $message, $config['members']['welcome_from'])){ savelog("logs/members.txt","Mail function error for members area registration for email \"".$email."\""); } // set login and pass to session $_SESSION['mdlogin']=$email; $_SESSION['mdpass']=md5(md5($password)); $logged_in=true; } } $query="INSERT INTO `ipn_subs`(`email`,`fname`,`lname`,`phone`,`country`,`zip`,`state`,`city`,`updated_at`) VALUES('".indb($email)."','".indb($fname)."','".indb($lname)."','".indb($phone)."','".indb($country)."','".indb($zip)."','".indb($state)."','".indb($city)."',NOW());"; mysql_query($query); me(mysql_error()); if(mysql_error()!="") savelog("access/logs/register_members.txt","Mysql saving user to subs table error: ".mysql_error()); // additionally save to file savelog("access/logs/subscribers.csv",$email.';'.$fname.';'.$lname.';'.$phone.';'.$country.';',true); }else{ $error="Password is too short. It should be at least 6 characters long."; $logged_in=false; } }else{ $error="Password confirmation does not match."; $logged_in=false; } }else{ $error="The e-mail address you used to purchase your license does not match the e-mail address you are trying to use for registration - please use this e-mail address \"".$email_is_same_value."\" instead, or contact customer support - http://forex-megadroid.com/support/"; $logged_in=false; } }else{ $error="The e-mail address entered is incorrect - please use your primary e-mail address."; $logged_in=false; } }elseif($_POST['receipt']!="" && strlen($_POST['email'])>5 && isset($_POST['password'])){ // Logging in and collecting data from existing user entry $query="SELECT * FROM `".$config['db_members']."` WHERE `email`='".indb($_POST['email'])."' LIMIT 1;"; $datax=mysql_query($query); me(mysql_error()); if(mysql_error()!="") savelog("access/logs/register_members.txt","Mysql search for user by email=".$_POST['email']." error: ".mysql_error()); if(mysql_num_rows($datax)>0){ // user exists // check if e-mail is the same by flag if($email_is_same){ $data=mysql_fetch_assoc($datax); if($data['password']==md5(md5($_POST['password']))){ // password is correct // fill variables $email=strtolower($data['email']); $password=$_POST['password']; $fname=ucwords($data['fname']); $lname=ucwords($data['lname']); $phone=$data['phone']; $address1=$data['address1']; $address2=$data['address2']; $zip=$data['zipcode']; $city=ucwords($data['city']); $state=strtoupper($data['state']); $country=ucwords($data['country']); $receipt=strtoupper($_POST['receipt']); $_SESSION['mdlogin']=$email; $_SESSION['mdpass']=md5(md5($password)); $logged_in=true; }else{ // password is incorrect $error="The password entered is incorrect. Please try again, or use Password Recovery."; sleep(1); $logged_in=false; } }else{ $error="The e-mail address you used to purchase your license does not match the e-mail address you are trying to use for registration - please use this e-mail address \"".$email_is_same_value."\" instead, or contact customer support - http://forex-megadroid.com/support/"; $logged_in=false; } }else{ $error="That e-mail address is not registered. Please use the correct e-mail address or try to register a new members area account."; $logged_in=false; } } } //// THIS PART SUBSCRIBES USER TO iCONTACT AND SENDS HIM CONFIRMATION E-MAIL FOR HIS BONUS_ID if this user is logged in/registered and his receipt is in DB //// // if user is logged in (just registered or just logged in) if($logged_in && $receipt_in_db_2){ $emails=array(); // e-mails to send $download_pages_for_email=array(); // DP array for e-mails $download_pages=array(); // download pages array $postdata=array(); $product_ids=array(); // product's ids // move the pointer to the beginning of resource if(mysql_num_rows($datax_receipts)>0){ mysql_data_seek($datax_receipts,0); } // list all receipts that has been found while($data=mysql_fetch_assoc($datax_receipts)){ // set PP $pp=$data['pp']; // if product is set for this receipt if($data['product']>0){ // get download page by product_id $query="SELECT `icontact_listid`,`icontact_specialid`,`icontact_clientid`,`icontact_formid`,`icontact_reallistid`,`icontact_doubleopt`,`download` FROM `".$config['db_products']."` WHERE `id`='".indb($data['product'])."' LIMIT 1;"; $datax2=mysql_query($query); me(mysql_error()); if(mysql_error()!="") savelog("access/logs/register_members.txt","Mysql search for product by id=".$data['product']." error: ".mysql_error()); if(mysql_num_rows($datax2)>0){ $data2=mysql_fetch_assoc($datax2); // save product id to array element $product_ids[]=$data['product']; // fill array element with download page URL for this product if(!empty($data2['download'])){ $download_pages[]=$data2['download']; $download_page_element=$data2['download']; // used for e-mails array } /*if($data2['icontact_listid']!=0){ // fill array element with array of iContact info from DB for this product $postdata[] = array('listid' => $data2['icontact_listid'], 'specialid:'.$data2['icontact_listid'] => $data2['icontact_specialid'], 'clientid' => $data2['icontact_clientid'], 'formid' => $data2['icontact_formid'], 'reallistid' => $data2['icontact_reallistid'], 'doubleopt' => $data2['icontact_doubleopt'], 'fields_fname'=>$fname, 'fields_lname'=>$lname, 'fields_email'=>$email, 'fields_phone'=>$phone, 'fields_country'=>$country, 'fields_zip'=>$zip, 'fields_state'=>$state, 'fields_city'=>$city, 'fields_address1'=>$address1, 'fields_address2'=>$address2, 'redirect'=>'http://www.icontact.com/www/signup/thanks.html', 'errorredirect'=>'http://www.icontact.com/www/signup/error.html' ); }*/ }else{ // no product has been found $download_pages[]="[NOT FOUND]"; savelog("access/logs/register_members.txt","No product with id=".$data['product']); } } // get confemail template id by bid $query="SELECT `confemail` FROM `".$config['db_bonuses']."` WHERE `id`='".indb($data['bid'])."' LIMIT 1;"; $datax2=mysql_query($query); me(mysql_error()); if(mysql_error()!="") savelog("access/logs/register_members.txt","Mysql search for confe-mail in bonuses by id=".$data['product']." error: ".mysql_error()); if(mysql_num_rows($datax2)>0){ $data2=mysql_fetch_assoc($datax2); // check if confemail is set if($data2['confemail']>0){ // fill array element with confemail id for this product $emails[]=$data2['confemail']; $download_pages_for_email[]=$download_page_element; unset($download_page_element); } }else{ // no bonus has been found savelog("access/logs/register_members.txt","No confemail for bonus with id=".$data['bid']." (Name: ".$fullname.", Receipt: ".$receipt.")"); } } // update user details in access and transactions tables only for affiliate sales if(!$cbtvalid){ // update access table with correct user details. Search by receipt. $query="UPDATE `".$config['db_access']."` SET `name`='".indb($fullname)."', `email`='".indb($email)."', `updated`=NOW() WHERE `code`='".indb($receipt)."';"; mysql_query($query); me(mysql_error()); if(mysql_error()!="") savelog("access/logs/register_members.txt","Mysql update receipt=".$receipt." with user details error: ".mysql_error()); // update Clickbank transactions with correct user details. Search by receipt. if($pp=="cb"){ $query="UPDATE `".$config['db_cbtrans']."` SET `ccustname`='".indb($fullname)."', `ccustemail`='".indb($email)."' WHERE `ctransreceipt`='".indb($receipt)."';"; mysql_query($query); me(mysql_error()); if(mysql_error()!="") savelog("access/logs/register_members.txt","Mysql update cbtransreceipt=".$receipt." with user details error: ".mysql_error()); } } //// Sending e-mails // find out how many e-mails to send $emailtosend=array_unique($emails); if(sizeof($emailtosend)==1){ // Send one single e-mail // insert download pages into one string divided by "\n" $dp=""; foreach($download_pages_for_email as $value){ $dp.=$value."\n"; } // get template id $et=""; foreach($emailtosend as $value){ $et=$value; } // Get Email template from DB $query="SELECT `id`,`title`,`from`,`subject`,`message` FROM `".$config['db_emails']."` WHERE `id`='".indb($et)."' LIMIT 1;"; $datax2=mysql_query($query); me(mysql_error()); if(mysql_error()!="") savelog("access/logs/register_members.txt","Mysql search for e-mail template with id=".$et." Error: ".mysql_error()); if(mysql_num_rows($datax2)>0){ // E-mail template exists $data=mysql_fetch_assoc($datax2); // Fill templates with variables /* %USER_FIRSTNAME% - First Name, %USER_LASTNAME% - Last Name, %USER_EMAIL% - User E-mail, %USER_RECEIPT% - User Receipt, %DOWNLOAD_PAGE% - Download page(s) for product(s) */ ///////////////////////////////// // Subject $data['subject']=str_replace("%USER_FIRSTNAME%",$fname,$data['subject']); $data['subject']=str_replace("%USER_LASTNAME%",$lname,$data['subject']); $data['subject']=str_replace("%USER_EMAIL%",$email,$data['subject']); $data['subject']=str_replace("%USER_RECEIPT%",$receipt,$data['subject']); // Message $data['message']=str_replace("%USER_FIRSTNAME%",$fname,$data['message']); $data['message']=str_replace("%USER_LASTNAME%",$lname,$data['message']); $data['message']=str_replace("%USER_EMAIL%",$email,$data['message']); $data['message']=str_replace("%USER_RECEIPT%",$receipt,$data['message']); $data['message']=str_replace("%DOWNLOAD_PAGE%",$dp,$data['message']); $to = $email; $subject = $data['subject']; $message = $data['message']; $headers = "From: ".$data['from']. "\r\n" . "Reply-To: ".$data['from']. "\r\n" . "X-Mailer: PHP/" . phpversion(); // if(!send_email($email, $data['subject'], $data['message'], $data['from'])){ if(!mail($to, $subject, $message, $headers)){ savelog("access/logs/register_members.txt","Mail function error for receipt \"".$receipt."\". E-mail: ".$email."."); } }else{ // E-mail Template doesn't exist savelog("access/logs/register_members.txt","Email Template with ID=".$et." doesn't exist!"); } }else{ // Send an e-mail for each receipt foreach($emails as $i => $template_id){ // Get Email template from DB $query="SELECT `id`,`title`,`from`,`subject`,`message` FROM `".$config['db_emails']."` WHERE `id`='".indb($template_id)."' LIMIT 1;"; $datax2=mysql_query($query); me(mysql_error()); if(mysql_error()!="") savelog("access/logs/register_members.txt","Mysql search for e-mail template with id=".$et." Error: ".mysql_error()); if(mysql_num_rows($datax2)>0){ // E-mail template exists $data=mysql_fetch_assoc($datax2); // Fill templates with variables /* %USER_FIRSTNAME% - First Name, %USER_LASTNAME% - Last Name, %USER_EMAIL% - User E-mail, %USER_RECEIPT% - User Receipt, %DOWNLOAD_PAGE% - Download page(s) for product(s) */ ///////////////////////////////// // Subject $data['subject']=str_replace("%USER_FIRSTNAME%",$fname,$data['subject']); $data['subject']=str_replace("%USER_LASTNAME%",$lname,$data['subject']); $data['subject']=str_replace("%USER_EMAIL%",$email,$data['subject']); $data['subject']=str_replace("%USER_RECEIPT%",$receipt,$data['subject']); // Message $data['message']=str_replace("%USER_FIRSTNAME%",$fname,$data['message']); $data['message']=str_replace("%USER_LASTNAME%",$lname,$data['message']); $data['message']=str_replace("%USER_EMAIL%",$email,$data['message']); $data['message']=str_replace("%USER_RECEIPT%",$receipt,$data['message']); $data['message']=str_replace("%DOWNLOAD_PAGE%",$download_pages_for_email[$i],$data['message']); $to = $email; $subject = $data['subject']; $message = $data['message']; $headers = "From: ".$data['from']. "\r\n" . "Reply-To: ".$data['from']. "\r\n" . "X-Mailer: PHP/" . phpversion(); // if(send_email($email, $data['subject'], $data['message'], $data['from'])){ if(!mail($to, $subject, $message, $headers)){ savelog("access/logs/register_members.txt","Mail function error for receipt \"".$receipt."\". E-mail: ".$_POST['email']."."); } }else{ // E-mail Template doesn't exist savelog("access/logs/register_members.txt","Email Template with ID=".$et." doesn't exist!"); } } } // redirect or show download pages $dptoshow=array_unique($download_pages); if(sizeof($dptoshow)==1){ // Redirect to the download page // get single download page url $dp=""; foreach($dptoshow as $value){ $dp=$value; } $redirect=$dp; }else{ // insert download pages into the string $dp=""; foreach($download_pages as $value){ $dp.="".$value."

"; } } // send to icontact if(sizeof($postdata)>0){ for($i=0;$i '9893290', 'specialid:9893290' => 'PPO9', 'clientid' => '402311', 'formid' => '4402', 'reallistid' => '1', 'doubleopt' => '0', 'fields_fname'=>$fname, 'fields_lname'=>$lname, 'fields_email'=>$email, 'fields_phone'=>$phone, 'fields_country'=>$country, 'fields_zip'=>$zip, 'fields_state'=>$state, 'fields_city'=>$city, 'fields_address1'=>$address1, 'fields_address2'=>$address2, 'redirect'=>'http://www.icontact.com/www/signup/thanks.html', 'errorredirect'=>'http://www.icontact.com/www/signup/error.html' ); $response=do_post_request("http://app.icontact.com/icp/signup.php", http_build_query($postdata)); } // send to icontact autoresponder lists /* $autoresponders=""; $account_id=""; for($i=0;$i 0 LIMIT 15;"; $datax=mysql_query($query); if(mysql_num_rows($datax)>0){ if(IContactGetAccountId($config['icontact']['key'],$config['icontact']['user'],$config['icontact']['pass'], $account_id)){ if(IContactAddContact($account_id,$config['icontact']['key'],$config['icontact']['user'],$config['icontact']['pass'], $email, $fname, $lname, $result_str)){ while($data=mysql_fetch_assoc($datax)){ if($data['autoresp']>0){ if(!IContactSubscribe($account_id, $config['icontact']['key'],$config['icontact']['user'],$config['icontact']['pass'], $email, $data['autoresp'], $result_str)){ savelog("access/logs/register_members.txt","Error while subscription to the list \"".$data['autoresp']."\" on IContact: ".$result_str." (E-mail: ".$email.", Code: ".$receipt.")"); } } } }else{ savelog("access/logs/register_members.txt","Error while adding new contact to iContact: ".$result_str." (E-mail: ".$email.", Code: ".$receipt.")"); } }else{ savelog("access/logs/register_members.txt","Error while getting AccountId for iContact account (E-mail: ".$email.", Code: ".$receipt.")"); } } */ } if($redirect!=""){ header("Location: ".$redirect); } ######################################## // Connect to remote MYSQL for PIPJET // ######################################## if($cbtvalid && !isset($_POST['receipt'])){ if(!empty($_GET['sl'])){ if(is_numeric($_GET['sl']) && !isset($_COOKIE['pj_slcustomer_'.$_GET['sl']])){ mysql_close($sql); include_once("access/mysql/connect_pj.inc.php"); if($cb_affiliate=="0"){ $cb_affiliate=""; } $query="INSERT INTO `pj_slstats`(`id`,`sl`,`type`,`affiliate`,`ip`,`timestamp`) VALUES('','".indb($_GET['sl'])."','sale','".indb($cb_affiliate)."','".indb($_SERVER['REMOTE_ADDR'])."',NOW())"; mysql_query($query); if(mysql_error()==""){ @setcookie("pj_slcustomer_".$_GET['sl'],"1",time()+60*60*24*365); } mysql_close($sql2); } } } ################################################ // *** Connect to remote MYSQL for PIPJET *** // ################################################ ?> Forex Megadroid Members Area Registration */ ?>

Get a Special Gift from Megadroid Team

Fill in your home address to the forms and you will get the gift shipped to you as soon as possible!

Forms coming here soon... To close the window you can click on "X" or anywhere outside the window...

*/ ?>
 

Thank you for your order!

Your transaction has been completed successfully.

Please remember that this purchase will appear on your bank or credit card statement as a charge from ClickBank or CLKBANK*COM.

Download pages:

Your license has been partly activated but, to reach the download page, you need to complete the details below.

Your Transaction ID (Receipt Code) is: