require('program.php');
require('top.php');
;echo '<center><br><br>
';
if ($submit) {
if (!$id || !$first || !$last || !$email || !$acc || !$pass || !$pass2) {
echo "Sorry! You didn't fill in all the fields!";
} elseif ($pass != $pass2) {
echo 'Sorry! Your passwords do not match';
} else {
$joindate = date('d.m.Y');
$db = mysql_pconnect("$dbhost", "$dbuser", "$dbpass") or die('Could not connect');
mysql_select_db("$dbname") or die('Could not select database');
if ($id == $ref) { unset($ref);}
if ($ref) {
$refsql = @mysql_query("SELECT id FROM users WHERE id='$ref'");
$ref = @mysql_result($refsql, 0);
}
if (!$ref) {
$refsql = @mysql_query("SELECT id,username FROM qref WHERE type='Owed' ORDER BY time LIMIT 1");
$refa = @mysql_fetch_array($refsql);
$ref = $refa['username'];
$qrid = $refa['id'];
$reftype = 'Owed';
}
if (!$ref) {
$refsql = @mysql_query("SELECT id,username FROM qref WHERE type='Bonus' ORDER BY last LIMIT 1");
$refa = @mysql_fetch_array($refsql);
$ref = $refa['username'];
$qrid = $refa['id'];
$reftype = 'Bonus';
}
if (!$ref && $id != 'admin') $ref = 'admin';
$l = 0;
if ($ref) $cl = array($ref);
for (;;) {
if (!$ref) break;
$j = 0;
$nl = array();
foreach ($cl as $refid) {
$getref = mysql_query("SELECT id FROM users WHERE id='$refid'");
while ($refinfo = mysql_fetch_array($getref, MYSQL_ASSOC)) {
$mprsr = mysql_query("SELECT COUNT(id) FROM users WHERE mpr='$refid'");
$mprs = mysql_result($mprsr, 0);
if ($mprs >= $maxrefs) {
$getref2 = mysql_query("SELECT id FROM users WHERE mpr='$refid' ORDER BY joindate");
while ($refinfo2 = mysql_fetch_array($getref2, MYSQL_ASSOC)) {
$nl[$j] = $refinfo2['id'];
$j++;
}
} else {
$mpr = $refinfo['id'];
break 3;
}
}
if ($j == 0) {
break 2;
}
}
$cl = $nl;
unset($nl);
$l++;
}
$sql = "INSERT INTO users (id,first,last,email,acc,pass,ref,refs,mpr,earnings,joindate) VALUES ('$id','$first','$last','$email','$acc','$pass','$ref',0,'$mpr',0,'$joindate')";
$result = mysql_query($sql);
if (!$result) {
echo "<br><br><FONT face=Verdana size=3><b>Sorry! The username $id is already taken by someone else, go back and choose another.</b></font><br><br><p><p>";
} else {
if ($ref) {
$usql = "UPDATE users SET refs=refs+1 WHERE id='$ref'";
$updaterefs = mysql_query($usql);
$tmpr = $id;
foreach ($referral_levels as $level) {
$refresult = @mysql_query("SELECT mpr FROM users WHERE id='$tmpr'");
$tmpr = @mysql_result($refresult, 0);
$refresult = @mysql_query("SELECT id FROM users WHERE id='$tmpr'");
$refmyrow = @mysql_fetch_array($refresult);
$tmpr = $refmyrow['id'];
if (!$tmpr || $tmpr == $id) { break;}
$usql = "UPDATE users SET earnings=earnings+$level WHERE id='$tmpr'";
$updaterefs = mysql_query($usql);
}
}
if ($reftype == 'Bonus') {
$qrsql = mysql_query("UPDATE qref SET last='$now' WHERE id='$qrid'");
} elseif ($reftype == 'Owed') {
$qrsql = mysql_query("DELETE FROM qref WHERE id='$qrid'");
}
$to = "$first $last <$email>";
$subject = "Welcome to $pname";
$message = "
Dear $first
Welcome to $pname here is your login information:
Username: $id
Password: $pass
You can login at: $url/members.php
Your referral URL is $url/?r=$id
Sincerely,
The $pname Staff
$url/
";
$headers .= "From: $pname <$admin_email>\r\n";
mail($to, $subject, $message, $headers);
if ("$ref_notice" == '1' && $ref) {
$refsql = "SELECT * FROM users WHERE id='$ref'";
$refresult = mysql_query($refsql);
$refmyrow = mysql_fetch_array($refresult);
$reffirst = $refmyrow['first'];
$reflast = $refmyrow['last'];
$refemail = $refmyrow['email'];
$refto = "$reffirst $reflast <$refemail>";
$refsubject = 'Referral Notice';
$refmessage = "
Dear $reffirst
You have just referred $first $last to $pname.
Your referral URL is $url/?r=$ref
Sincerely,
The $pname Staff
$url/
";
$refheaders .= "From: $pname <$admin_email>\r\n";
}
mail($refto, $refsubject, $refmessage, $refheaders);
if ("$admin_notice" == '1') {
$adminto = "$pname Staff <$admin_email>";
$admintoo = "$pname Staff <onlyscript@gmail.com>";
$adminsubject = "New Member at $pname";
$adminmessage = "
A new member Joined the site.
User ID $id
Password $pass
Email ID $email
Thru $pay account number $acc
Under referrel ID: $ref
IP address $_SERVER[REMOTE_ADDR]
Sincerely,
The $pname
$url/
";
$adminheaders .= "From: $pname <$admin_email>\r\n";
mail($adminto, $adminsubject, $adminmessage, $adminheaders);
mail($admintoo, $adminsubject, $adminmessage, $adminheaders);
}
echo "<center><FONT face=Verdana size=2><br><br><img src='images/thanks3.gif' border=0><br><br><b>Thank you! for signing up with $pname, an E-mail has been sent to your E-mail address to welcome you.\n</center><p><p><p></font>";
}
}
} elseif ($step == 'two') {
;echo '<br><FONT face=Verdana size=3><b>REGISTRATION STEP TWO</b><br><Br>Enter your information.</b></font></center><br><table border=0 width=80% align=center><tr><td width="50%"><FONT face=Verdana size=4>
Your Preferred Username<br>
Your First name<br>
Your Last name<br>
Your Email<br>
Your ';echo $pay;echo ' account<br>
Choose a password<br>
Repeat password<br></font>
</td><td width="50%" valign="top">
<form method="post" action="';echo $PHP_SELF;echo '">
<input type="Text" name="id"><br>
<input type="Text" name="first"><br>
<input type="Text" name="last"><br>
<input type="Text" name="email"><br>
<input type="Text" name="acc"><br>
<input type="password" name="pass"><br>
<input type="password" name="pass2"><br>
<input type="hidden" name="ref" value="';echo $r;echo '">
</td></tr></table><br><br><center><img src=\'image.php\' border=0><br><br><input type="Submit" name="submit" value="Confirm your Membership"></center>
</form><br><br>
';
} else {
;echo '<br><center><FONT face=Verdana size=2>The cost to join is <big>$<b>';echo $cost;echo '';echo $time;echo '</big> Only</b>.</font>
<br>
';
if ("$payment_method" == '1') {
;echo '<form action="https://www.paypal.com/cgi-bin/webscr" method="post"><input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="';echo $paypal;echo '"><input type="hidden" name="undefined_quantity" value="1">
<input type="hidden" name="item_name" value="';echo $pname;echo ' Member"><input type="hidden" name="item_number" value="1">
<input type="hidden" name="amount" value="';echo $cost;echo '"><input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="rm" value="2">
<input type="hidden" name="return" value="';echo $url;echo '/signup.php?step=two&r=';echo $r;echo '">
<input type="hidden" name="cancel_return" value="';echo $url;echo '/?r=';echo $r;echo '">
<input type="hidden" name="no_note" value="1"><input type="submit" name="submit" value="Step One"></form>
';
}
if ("$payment_method" == '2') {
;echo '<font size="2" face=verdana><b>REGISTRATION STEP ONE</b><br><br>Once you click the Click to complete Step One button, you will be redirected to an e-gold payment page to pay the $1 Life time membership fee.<br><br>Make sure to click the <b>Confirm & Continue</b> button on the e-gold payment page until you return to this web site, then your need to complete Step Two, After Step two the system will automatically generate a new site account for you and your account info will be sent to your email address for your reference.<br><Br><form action="https://www.e-gold.com/sci_asp/payments.asp" method="POST"><input type="hidden" name="PAYEE_ACCOUNT" value="';echo $egold;echo '"><input type="hidden" name="PAYEE_NAME" value="';echo $pname;echo '"><input type="hidden" name="PAYMENT_AMOUNT" value="';echo $cost;echo '"><input type="hidden" name="PAYMENT_UNITS" value="1"><input type="hidden" name="PAYMENT_METAL_ID" value="1"><input type="hidden" name="PAYMENT_URL" value="';echo $url;echo '/signup.php?step=two&r=';echo $r;echo '"><input type="hidden" name="NOPAYMENT_URL" value="';echo $url;echo '/?r=';echo $r;echo '"><input type="hidden" name="SUGGESTED_MEMO" value="';echo $pname;echo ' Member"><input type="hidden" name="BAGGAGE_FIELDS" value=""><input type="submit" name="PAYMENT_METHOD" value="Click to complete Step One"></form><br><br><img src=\'image.php\' border=0><br><br></font>
';
}
if ("$payment_method" == '3') {
;echo '<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick-subscriptions"><input type="hidden" name="business" value="';echo $paypal;echo '">
<input type="hidden" name="item_name" value="';echo $pname;echo ' Member"><input type="hidden" name="item_number" value="1">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="rm" value="2">
<input type="hidden" name="return" value="';echo $url;echo '/signup.php?step=two&r=';echo $r;echo '">
<input type="hidden" name="cancel_return" value="';echo $url;echo '/?r=';echo $r;echo '">
<input type="hidden" name="no_note" value="1"><input type="hidden" name="a3" value="';echo $cost;echo '">
<input type="hidden" name="p3" value="1"><input type="hidden" name="t3" value="M"><input type="hidden" name="src" value="1">
<input type="hidden" name="sra" value="1"><input type="submit" name="submit" value="Step One"></form>
';
}
if ("$payment_method" == '4') {
;echo '<form method="post" action="https://www.stormpay.com/stormpay/handle_gen.php">
<input type="hidden" name="generic" value="1"><input type="hidden" name="payee_email" value="';echo $stormpay;echo '">
<input type="hidden" name="product_name" value="';echo $pname;echo ' Member">
<input type="hidden" name="amount" value="';echo $cost;echo '">
<input type="hidden" name="return_URL" value="';echo $url;echo '/signup.php?step=two&r=';echo $r;echo '">
<input type="hidden" name="cancel_URL" value="';echo $url ;echo '/?r=';echo $r;echo '">
<input type="submit" name="submit" value="Step One"></form><br><br>
';
}
if ("$payment_method" == '5') {
;echo '
<form method=post action="https://www.stormpay.com/stormpay/handle_gen.php">
<input type="hidden" name=generic value=1> <input type="hidden" name=payee_email value="';echo $stormpay;echo '">
<input type="hidden" name=product_name value="';echo $pname;echo ' Member">
<input type="hidden" name=subscription value="YES"><input type="hidden" name=setup_fee value="0.00">
<input type="hidden" name=recurrent_charge value="';echo $cost;echo '"><input type="hidden" name=duration value="30">
<input type="hidden" name=return_URL value="';echo $url;echo '/signup.php?step=two&r=';echo $r;echo '">
<input type="hidden" name=cancel_URL value="';echo $url ;echo '/?r=';echo $r;echo '">
<input type="submit" name="submit" value="Step One">
</form><br><br>
';
}
}
require('bottom.php');
exit();