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"; } } ?> Member Login "; print ""; print " "; print " "; print " "; print ""; print " "; print "
"; print "

"; print ""; print "

"; print "
"; print "

LOGIN / REGISTER

"; 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 ""; print " "; print " "; print " "; print ""; print " "; print "
"; print "

"; print ""; print "

"; print "
"; print "

LOGIN / REGISTER

"; 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

"; } } elseif ($tobejoined=="Y") { print ""; print ""; print " "; print " "; print " "; print ""; print " "; print "
"; print "

"; print ""; print "

"; print "
"; print "

LOGIN / REGISTER

"; print "
"; print "
"; print "

Your Membership has been created and we have sent you an email.
To activate your membership please take the link provided in that email.

To return to our site please take the link below.

"; print "

RETURN TO PREVIOUS PAGE

"; } else { print ""; print ""; print ""; print " "; print " "; print ""; print ""; print "
"; print "

"; print "
"; print "

LOGIN / REGISTER

"; print "
"; print "
"; // main content goes here if ($formerror=="1" or $firstin!="N") { print "

 

"; print "
"; print "
"; print ""; print ""; print " "; print " "; print ""; print ""; print " "; print " "; print ""; print ""; print " "; print ""; if ($errflg1=="1" or $errflg2=="1") { print " "; print " "; print " "; print " "; print " "; print ""; } print "
"; print "

Member Id : 

"; print " "; print " "; print "
"; print "

Password : 

"; print " "; print " "; print "
"; print "

"; print " "; print " "; print " "; print "

"; print "  "; print "

 

"; print " "; if ($errflg1=="1") {print "Member ID Is Invalid";} print " "; print " "; print " "; if ($errflg2=="1") {print "Password Is Invalid";} print " "; print "
"; print "
"; print "
"; print "
"; print "

Forgotten your codes?  "; print " "; print " "; print " "; print " "; print " "; print " "; print "

"; print "
"; // join up stuff and form goes here print "

JOINING US AS A MEMBER IS FREE

"; print "

"; print "Join us as a FREE FOR EVER member today and we will give you a personal library into which will be placed any ebooks you buy from us so you can keep a track of what you have bought - and our software will ensure you don't buy the same book from us again.

"; print "

"; print "If you wish to become one of our authors, (exclusive or self-publishing), or you are a publisher wishing to sell on our site, you must also join us as a member.

"; print "
"; print "

Our membership rules are as follows:

"; print "
    "; print "
  1. "; print "

    "; print " "; print " When you join us below, we will send you an activation email. YOU MUST ACTIVATE your membership BEFORE you can purchase or download any books, or publish on this site.

  2. "; print "
  3. "; print "

    "; print " "; print " As a member you will have your own personal library where we put any ebooks you buy from us.

  4. "; print "
  5. "; print "

    "; print " "; print " When you join us today, you have seven days to activate your membership or your details will be deleted.

  6. "; print "
  7. "; print "

    "; print " "; print " We ask that you only have one member account. If you lose your access codes there are options on the login screen for you to recover them.

  8. "; print "
  9. "; print "

    "; print " "; print " If at any time you or your ISP bounce any emails from us, such as any newsletters you subscribe to, then your member account will be locked and you will need to provide a different non-bouncing email address to unlock your account.

  10. "; print "
  11. "; print "

    "; print " "; print " All members agree to keep their member id and password secret. Any member found sharing their access codes will have their account terminated and may face prosecution for up to $50,000 damages.

  12. "; print "
"; print "
"; print "

 

"; print "
"; print "
"; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print "
COMPLETE THE FORM BELOW TO JOIN US
Your E-Mail Address will remain totally confidential unless you decide otherwise.
Please use only letters A - Z and numbers 0 - 9 when creating your Member Id and Password.
"; print "

Member Id (4-20 letters) :

"; print "

"; print " "; if ($errflg3=="1") {print "
Your Member Id must be 4 to 20 characters and contain no spaces
";} if ($errflg3=="2") {print "
That Member Id is not available
";} print "

"; print "
"; print "

Password (4-20 letters) :

"; print "

"; print " "; if ($errflg4=="1") {print "
Your password must be 4 to 20 characters
";} if ($errflg4=="2") {print "
Passwords don't match - please retype.
";} print "

"; print "
"; print "

Type Password Again (For Confirmation) :

"; print "

"; print "

"; print "

E-mail Address :

"; print "

"; print " "; if ($errflg5=="1") {print "
Your email address is invalid or already in use.
";} if ($errflg5=="2") {print "
We are no longer allowing addresses such as you have provided as they block our emails to our customers and members.
";} if ($errflg5=="3") {print "
This address is on our banned list. If you think this is incorrect please contact the webmaster@fiction4all.com.
";} print "

"; print "

Please select your country of residence:

"; print ""; if ($errflg6=="1") {print "
Your country of residence is required.";} print "
"; print "

Subscribe to our Marketing Emails - be inforomed! :

"; print "

Yes"; if ($nletter=="Y") { print " No"; print " "; } else { print " No"; print " "; } print "

"; print " "; print " "; print " "; print "
"; print "
"; print "
"; print "

RETURN TO PREVIOUS PAGE

"; } else { if ($mbrcountry=="" or $mbrcountry==" ") { print "

MEMBER LOGIN

"; print "

 

"; print "
"; print "
"; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print "
We need to record your country of residence. Please update your country of residence from the table below."; print "
"; print "

Please select your country from the list in this table:

"; print "
"; print "

"; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print "

"; print "
"; print "
"; } elseif ($embounce=="N") { // 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; } 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 { // process inactive or bouncing member if ($embounce=="Y") { print "

MEMBER LOGIN - FAILURE

"; print "

 

"; print "
"; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print " "; print "
YOU HAVE EITHER NOT ACTIVATED YOUR MEMBERSHIP OR YOU HAVE BEEN BOUNCING EMAILS IF A SUBSCRIBER
"; print "

To Have your activation code resent to you:

"; print " "; print " CLICK HERE"; print "
"; print "

If you do not receive your activation email,
probably your email address is wrong or your Inbox is full.
To check and Update Your Email Address:

"; print " "; print " CLICK HERE"; print "
"; } elseif ($embounce=="X") { print "

 

"; print "
"; print " "; print " "; print " "; print " "; print "
YOUR ACCOUNT IS CURRENTLY UNDER INVESTIGATION.
WE HAVE EMAILED YOU AND ARE AWAITING A REPLY BEFORE WE CAN COMPLETE OUR INVESTIGATION.
"; } } // end of bouncing/inactive processng } // end of not firstin or error // end of the listing print "
"; } ?>