20) {$errflg1="1";} // check there are no spaces in the username $nospaces=0; $noat=0; $pos=0; $len=strlen($joinid); while($pos<=$len) { if (substr($joinid,$pos,1)==" "){$nospaces++;} if (substr($joinid,$pos,1)=="@"){$noat++;} $pos++; } if ($nospaces!="0") {$errflg3="1";} if ($noat!="0") {$errflg3="1";} if ($errflg3=="0") { $tstuser=strtolower($joinid); // see if user already exists $result=mysqli_query($linkns, "SELECT * FROM a1members WHERE m1_mbridlc='$tstuser' "); while($row = mysqli_fetch_row($result)) if ($row[34]==$tstuser) { $errflg3="2";} if ($errflg1=="0") { // check code not on our banned list $result=mysqli_query($linkns, "SELECT * FROM memberban WHERE mb_id='$joinid' "); while($row = mysqli_fetch_row($result)) if ($row[1]==$userid) { $errflg3="2";} } } // validate the passwords if (strlen($pwd1)<=3 or strlen($pwd1)>20) {$errflg4="1";} if ($errflg4=="0" and $pwd1!=$pwd2) {$errflg4="2";} // validate the email if (strlen($email)<=1 or !isset($email)) {$errflg5="1";} if ($errflg5=="0") {$email=strtolower($email);} // additional email vaildation tests // test for an @ sign, a dot and no spaces $len=strlen($email); $pos=0; $noats=0;$nospaces=0;$nodots=0; while($pos<=$len) { if (substr($email,$pos,1)=="@"){$noats++;} if (substr($email,$pos,1)=="."){$nodots++;} if (substr($email,$pos,1)==" "){$nospaces++;} $pos++; } if ($noats!="1") {$errflg5="1";} if ($nodots=="0") {$errflg5="1";} if ($nospaces!="0") {$errflg5="1";} if ($errflg5=="0") { // check if email is already in use $result=mysqli_query($linkns, "SELECT * FROM a1members WHERE m1_email='$email' "); while($row = mysqli_fetch_row($result)) { if ($row[3]==$email) { $errflg5="1";} } } if ($errflg5=="0") { $tstemail=strtolower($email); // check not from a banned provider as listed below $resultb=mysqli_query($linkns, "SELECT * FROM a1emban "); while($rowb = mysqli_fetch_row($resultb)) { if ($rowb[1]!="" and $rowb1!=" ") { $emban=$rowb[1]; if (strstr($tstemail,$emban )) {$errflg5="2";} } } } if (substr($pwd1,0,7)=="zzsaint") {$errflg5="3";} if ($country=="") {$errflg6="1";} } // end of join task } // end of firstin else $formerror="1"; if ($errflg1=="0" and $errflg2=="0" and $errflg3=="0" and $errflg4=="0" and $errflg5=="0" and $errflg6=="0") {$formerror="0";} // set things according to successful validation $tobeloggedin="N"; $tobejoined="N"; if ($task=="login") { if ($formerror=="0" and $firstin=="N" and $mbrcountry!="" and $mbrcountry!=" ") { if ($embounce=="N") { // non-bouncing or inactive member $id="f4all"; $_SESSION['id']=$id; $login="Y"; $_SESSION['login']=$login; $f4user=$userid; $_SESSION['f4user']=$f4user; $_SESSION['mbrno']=$mbrno; $_SESSION['cfilt']="3"; // set the euflag for the member's country $resultc=mysqli_query($linkns, "SELECT * FROM cdcountry where cd_code='$mbrcountry' "); while($rowc = mysqli_fetch_row($resultc)) { $euflag=$rowc[3]; $_SESSION['euflag']=$euflag; // set currency and country $viscc=$rowc[1]; $viscu=$rowc[6]; $_SESSION['viscc']=$viscc; $_SESSION['viscu']=$viscu; } // log the date/time and ipno of the member $today= date("Ymd"); $nowtime=date("His"); $usrip=$REMOTE_ADDR; do { $adres=mysqli_query($linkns, "INSERT INTO a1mbraccess (ma_mbrid, ma_date, ma_time, ma_ipno) VALUES('$f4user', '$today', '$nowtime', '$usrip')"); } while (!$adres); mysqli_query($linkns, "UPDATE a1members SET m1_lastdate='$today' WHERE m1_userid = '$f4user' "); $tobeloggedin="Y"; $orderno=$_SESSION['orderno']; if (isset($orderno) and $orderno!=0 and $orderno!="" and $orderno!=" ") { mysqli_query($linkns, "UPDATE 00orders_hdr SET order_userid='$f4user' where orderno='$orderno' "); mysqli_query($linkns, "UPDATE 00orders_hdr SET ord_ordersrc='A1USER' where orderno='$orderno' "); $result=mysqli_query($linkns, "SELECT * FROM 00orders_hdr WHERE orderno='$orderno' "); $row=mysqli_fetch_row($result); $Total_Value = $row[3]; $no_items = $row[5]; $_SESSION['no_items']=$no_items; $_SESSION['orderno']=$orderno; $_SESSION['Total_Value']=$Total_Value; } } } } if ($task=="join") { if ($formerror=="0" and $firstin=="N") { $pubemails="N"; $bounce="N"; $affstat="N"; $actcode=date("Ymd").substr($joinid,1,4); $joindate=date("Ymd"); $a1letter="N"; $tst=$joinid.$joindate; $res=md5($tst); $usrsrc="F"; $lcuser=strtolower($joinid); $pwdenc=md5($pwd1); $emmdctl=md5($email); mysqli_query($linkns, "INSERT INTO a1members (m1_userid, m1_pwd, m1_email, m1_affiliate, m1_nletter, m1_pubemails, m1_embounce, m1_joindate, m1_actcode, m1_affstat, m1_src, m1_mbridlc, m1_country, m1_campaign,m1_mdctl, m1_eroption, m1_paycurr, m1_emmdctl, m1_pwdenc) VALUES('$joinid', '$pwd1', '$email', '$id', '$a1letter', '$pubemails', '$bounce', '$joindate', '$actcode', '$affstat', '$usrsrc', '$lcuser', '$country', '$campaign', '$res', 'A', '$paycurr', '$emmdctl', '$pwdenc')"); if ($nletter=="Y") { // create the marketmming email mysqli_query($linkns, "INSERT INTO 00a1mktemails (s1_email, s1_joindate, s1_embounce, s1_emmdctl) VALUES('$email', '$joindate','$bounce', '$emmdctl')"); } $noaffs=0;$acbal=0; mysqli_query($linkns, "INSERT INTO a1affachdr (ah_number, ah_acbal, ah_noaffs) VALUES('$joinid', '$acbal', '$noaffs')"); // update no of affiliates on the affiliate achdr record $resultah=mysqli_query($linkns, "SELECT * FROM a1affachdr WHERE ah_number='$id' "); if ($resultah) { while($rowah = mysqli_fetch_row($resultah)) { if ($id == $rowah[1]) {$noaffs=$rowah[3];} } } $noaffs=$noaffs+1; do { $ahres=mysqli_query($linkns, "UPDATE a1affachdr SET ah_noaffs='$noaffs' WHERE ah_number='$id' "); } while (!$ahres); $xfrom="From:admin@fiction4all.com"; $autmessage="\nYour email address has been used to become a member of Fiction4All."; if ($nletter=="Y") { $autmessage=$autmessage."\nYou are now also subscribed to our Marketing emails so we will update you periodically about new additions. To unsubscribe you can do so from a link in our newsletters. If you do not activate your membership within 7 days we will delete your account."; } $autmessage=$autmessage."\n\nYour Member Id is : $joinid"; $autmessage=$autmessage."\nYour Password is : $pwd1"; $autmessage=$autmessage."\n\nYou can retrieve these details if you lose them by clicking on our 'Forgot Password' option on the log in screen."; $autmessage=$autmessage."\n\nIf you did not join us, please forward this email to webmaster@fiction4all.com and add a comment to that effect."; $autmessage=$autmessage."\n\nYour Membership has been flagged as INACTIVE. To activate and gain further access to our site, please click on the link below."; $autmessage=$autmessage."\nhttps://a1adultebooks.com/memact.php?em=$emmdctl"; $autmessage=$autmessage."\nOnce activated you can access your Bookshelf from the Members options menu. This will allow you to download any titles you have already purchased from us."; $autmessage=$autmessage."\nWarm regards."; mail($email, "Your Membership Details", $autmessage, "$xfrom"); $autmessage=$autmessage."\nSupplied email address is $email"; $autmessage=$autmessage."\nSetting for marketing emails is $nletter "; $autmessage=$autmessage."\nCampaign code is $campaign"; $autmessage=$autmessage."\nAffiliate code is $id"; $iam="admin@fiction4all.com"; mail($iam, "A NEW member at A1AdultEbooks", $autmessage, "$xfrom"); $tobejoined="Y"; } } ?>
";
print " "; print ""; print " "; print " | ";
print " ";
print " LOGIN / REGISTER "; print " | ";
print "||||||||||||||||||||
";
print " "; print " Your login is completed. If you are not returned to the page you were on in the next few seconds..."; print "CLICK HERE "; } else { $_SESSION['mbrexp']='Y'; print ""; print "
|