PDO::ERRMODE_EXCEPTION, PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, PDO::ATTR_EMULATE_PREPARES => false ]; $dsn = "mysql:host=$dbconnecturl;dbname=$dbname"; try { $conn = new PDO($dsn, $mysqlname, $mysqlpw, $options); } catch(PDOException $e) { echo "Yavip system was maintenance, please try it later!!
This maintenance may take several minutes to hours.

Thank you very much for your patience.
Technical Dept. of yavip.com"; } /******/ Function forgetpasswd1() { global $conn; /* check if this is valid user id */ $itemstr="SELECT lastname, firstname, passwd FROM usertable_english where userid=:userid"; $sth = $conn->prepare($itemstr); $sth->bindParam(':userid', $enteruserid, PDO::PARAM_STR); $sth->execute(); $rowcountsum = $sth->rowCount(); $data=$sth->fetchAll(); foreach($data as $row) { $lastname = $row['lastname']; $firstname = $row['firstname']; $passwd = $row['passwd']; } if($rowcountsum > 0) { /* this id existed */ $fd=popen("/usr/sbin/sendmail -t", "w"); fputs($fd, "Content-type: text/html\r\n"); fputs($fd, "Subject: [Password Request yavip.com]\r\n"); fputs($fd, "From: account@yavip.com\r\n"); fputs($fd, "To: $firstname $lastname<$enteruserid>\r\n"); fputs($fd, "The following is your password as your request at yavip:

"); fputs($fd, "Your Password: $passwd

"); fputs($fd, "
Power by yavip.com networks

$snemail\n"); pclose($fd); echo "

Password request sent out to your e-mail box. You may check and get it now.

"; echo "

Back to main page

"; } else { /* id not existed */ forgetpasswd($fgtpassid=notexisted); } }; /* forgetpasswd1 */ Function forgetpasswd($fgtpassid) { global $conn; echo "

"; /************/ echo ""; echo ""; echo ""; echo ""; echo "
"; /*********/ echo ""; echo " "; echo ""; echo ""; echo ""; echo ""; echo "
"; echo "

Enter your User ID (E-MAIL):

"; echo "
"; echo "

"; echo "

"; /*******/ echo "
"; /*******/ echo "
"; if($fgtpassid=="notexisted") { echo ""; echo " "; echo ""; echo ""; echo "
! The user ID $enteruserid entered was not a valid ID. You may re-enter your user ID again.

Or, you may click here and sign up.

"; } }; /* forgetpasswd */ Function clientlogout() { global $conn; /* record this user login time */ $selectstr="select curdate() as logindate"; $stmt = $conn->query($selectstr); $lastlogindate = $stmt->fetchColumn(); $insertstr="UPDATE usertable_english SET lastlogin=:lastlogin where passwd=:passwd AND userid=:userid"; $sth = $conn->prepare($insertstr); $sth->bindParam(':lastlogin', $lastlogindate, PDO::PARAM_STR); $sth->bindParam(':passwd', $registerscpasswd, PDO::PARAM_STR); $sth->bindParam(':userid', $registerscid, PDO::PARAM_STR); $sth->execute(); /* original- setcookie("firstvisit","","time()-3600","/","$rooturlnohttp"); */ if (isset($registerscid)) { setcookie("registerscid",""); } if (isset($registerscpasswd)) { setcookie("registerscpasswd",""); } /* user clicl on logout, then this user will be removed from onlinetable */ $deletestr="DELETE FROM onlinetable_english where onlineid=:onlineid"; $sth = $conn->prepare($deletestr); $sth->bindParam(':onlineid', $registerscid, PDO::PARAM_STR); $sth->execute(); main(); }; /* clientlogout */ Function newregister1() { global $conn; $lastname=htmlspecialchars($lastname, ENT_QUOTES); $firstname=htmlspecialchars($firstname, ENT_QUOTES); $selectstr="select curdate() as daytime"; $stmt = $conn->query($selectstr); $btime = $stmt->fetchColumn(); $btime=preg_replace('/-/i', "", $btime); $selectstr="select curtime() as ordertime"; $stmt = $conn->query($selectstr); $atime = $stmt->fetchColumn(); $atime=preg_replace('/:/i', "", $atime); /* get part of regid */ $pattern = "/[@.-_]/"; $components = preg_split($pattern, $userid); $regid = $components[0] . $atime . $btime; /* all filled ok */ /* insert record to temp usertable */ $insertstr="insert into usertemptable_english ( regid, userid, passwd, lastname, firstname, plugins, regdate ) values ( '$regid', '$userid', '$passwd', '$lastname', '$firstname', '$plugins', '$btime' )"; $conn->exec($insertstr); /* send to e-mail */ $fd=popen("/usr/sbin/sendmail -t", "w"); fputs($fd, "Content-type: text/html\r\n"); fputs($fd, "Subject: [Welcome to yavip. Account Confirmation]\r\n"); fputs($fd, "From: service@yavip.com\r\n"); fputs($fd, "To: $userid\r\n"); fputs($fd, "Hello $firstname

"); if(!empty($plugins)) { fputs($fd, "Welcome to register and join yavip with professional option of $plugins. Your confirmation# is: $regid.

"); } else { fputs($fd, "Welcome to register and join yavip. Your confirmation# is: $regid.

"); } fputs($fd, "Your ID : $userid
"); fputs($fd, "Password: $passwd

"); fputs($fd, "Please confirm and validate your yavip account by clicking here

"); fputs($fd, "Regards,
yavip.com

"); fputs($fd, "
Power by yavip.com networks

$snemail\n"); pclose($fd); /* show out */ /********/ echo ""; echo ""; echo ""; echo ""; echo "
"; /********/ echo ""; echo " "; echo ""; echo ""; echo " "; echo ""; echo ""; echo " "; echo ""; echo ""; echo " "; if(!empty($plugins)) { echo ""; } else { echo ""; } echo ""; echo " "; echo ""; echo ""; echo "
 
Confirm Your Email Address
 
Thank you for signing up on yavip with professional option of $plugins! We just sent you a confirmation email to $userid.Thank you for signing up on yavip! We just sent you a confirmation email to $userid.
Click on the confirmation link in your email to complete and validate your sign up.
"; /**********/ $gmailpos = strpos($userid, 'gmail.com'); if ($gmailpos !== false) { echo "

Go to your Gmail Now!!

"; } $yahoopos = strpos($userid, 'yahoo.com'); if ($yahoopos !== false) { echo "

Go to your Yahoo Mail Now!!

"; } $hotmailpos = strpos($userid, 'hotmail.com'); if ($hotmailpos !== false) { echo "

Go to your Hotmail Now!!

"; } $aolpos = strpos($userid, 'aol.com'); if ($aolpos !== false) { echo "

Go to your AOL Mail Now!!

"; } /*******/ echo "

"; /*******/ }; /* newregister1 */ Function newregister() { global $conn; $userid=trim($userid); $passwd=trim($passwd); $lastname=trim($lastname); $lastname=stripslashes($lastname); $lastname=strip_tags($lastname); $firstname=trim($firstname); $firstname=stripslashes($firstname); $firstname=strip_tags($firstname); /* check if all field filled out */ $userid=strtolower($userid); /* check if the user id-email is unique */ $selectstr="select * from usertable_english where userid=:userid"; $sth = $conn->prepare($selectstr); $sth->bindParam(':userid', $userid, PDO::PARAM_STR); $sth->execute(); $rowcountsum = $sth->rowCount(); if($rowcountsum == 0) { if (!filter_var($userid, FILTER_VALIDATE_EMAIL)) { $useremailst="! Your ID (e-mail) format error"; } else { $useremailok="ok"; } } else { $useremailst="! There is an existing account associated with $userid"; } /* check if passwd ok */ if(strlen($passwd) >= 6) { // if (ereg ("([0-9a-zA-Z]{1})([0-9a-zA-Z]{1})([0-9a-zA-Z]{1})([0-9a-zA-Z]{1})([0-9a-zA-Z]{1})([0-9a-zA-Z]{1})([0-9a-zA-Z]{1})([0-9a-zA-Z]{1})([0-9a-zA-Z]{1})([0-9a-zA-Z]{1})([0-9a-zA-Z]{1})([0-9a-zA-Z]{1})([0-9a-zA-Z]{1})([0-9a-zA-Z]{1})([0-9a-zA-Z]{1})([0-9a-zA-Z]{1})([0-9a-zA-Z]{1})([0-9a-zA-Z]{1})([0-9a-zA-Z]{1})([0-9a-zA-Z]{1})([0-9a-zA-Z]{1})([0-9a-zA-Z]{1})([0-9a-zA-Z]{1})([0-9a-zA-Z]{1})([0-9a-zA-Z]{1})", $passwd)) // { /* all character entered are correct */ $passwdok="ok"; // } // else // { // $passwdst="* Password only allows letter & numeric"; // } } else { $passwdst="! Password needs at least with 6 mixed letter & numeric"; } /*********/ /* check lastname */ if(!empty($lastname)) { $lastnameok="ok"; } else { $lastnamest="! Fill out last name"; } /********/ /* check lastname */ if(!empty($firstname)) { $firstnameok="ok"; } else { $firstnamest="! Fill out first name"; } /****/ if($useremailok=="ok" && $lastnameok=="ok" && $firstnameok=="ok" && $passwdok=="ok") { newregister1(); } /* end of if all of the fields are filled correct */ else /* there are some fields are not filled out correct */ { /* show out errors */ main(); /**********/ echo ""; echo ""; echo ""; echo ""; echo "
"; /**********/ echo ""; echo " "; echo ""; echo ""; echo " "; echo ""; echo ""; echo " "; echo ""; echo ""; echo " "; echo ""; echo ""; echo "
$useremailst
$passwdst
$lastnamest
$firstnamest
"; /**********/ echo "
"; /**********/ } }; /* newregister */ Function main() { global $conn; echo "

"; // echo ""; // echo ""; // echo ""; // echo ""; // echo ""; // echo "
"; // echo "
\"YAVIP
"; // echo "
"; // echo "
"; // echo "
"; echo ""; echo ""; echo ""; echo ""; echo "
"; // style="background: #FF9900;border: 0px solid #FF9900;font-family: Arial;font-size:14px" echo ""; echo " "; echo ""; echo ""; echo ""; echo " "; echo ""; echo ""; echo ""; echo " "; echo ""; echo ""; echo ""; echo " "; echo ""; echo ""; echo ""; // echo " "; // echo ""; // echo ""; echo ""; // echo " "; // echo ""; // echo ""; // echo ""; echo " "; echo ""; echo ""; echo ""; echo " "; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
"; echo "
First Name     
"; echo "
"; echo ""; echo "
"; echo "
Last Name     
"; echo "
"; echo ""; echo "
"; echo "
Your E-mail (ID)     
"; echo "
"; echo ""; echo "
"; echo "
Your Password     
"; echo "
"; echo ""; echo "
"; // echo "
Professional option 
"; // echo "
"; // echo ""; echo "
"; // echo "
"; // echo "
"; // echo "If you are professional individual or group, you could choose one of your PRO option signing up"; // echo "
"; echo "
"; echo "
"; echo ""; echo "
"; echo "
"; echo "
"; echo "
yavip a place with people and specialty from your hometown and around the world."; echo "
  "; echo "
"; echo ""; echo ""; echo "
"; echo "
"; /****/ echo "
"; /****/ echo "
"; echo ""; echo ""; echo ""; echo ""; echo "
"; echo "
yavip stands for: you are very important person @ yavip.com
"; echo "
"; }; /* end of main() */ /*******/ /***TOP OF TABLE***/ echo ""; echo " "; // echo ""; // echo ""; // echo ""; echo ""; echo ""; echo ""; echo ""; echo "
"; // echo "
"; // echo ""; // echo ""; // echo ""; // echo "
"; // echo "
"; echo "
ID "; echo ""; echo "  Password "; echo " "; echo ""; echo ""; echo "
"; echo "Not registered? Sign Up           Forget password?"; echo "
"; echo "

"; /**********/ echo "

"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
"; echo " 
"; echo "
"; echo ""; echo "
"; echo " 
"; echo "
"; echo ""; echo "
"; echo "
\"YAVIP
"; echo "
"; echo "
"; echo "

"; ///////// switch($checker): case ""; main(); break; case "newregister"; newregister(); break; case "clientlogout"; clientlogout(); break; case "forgetpasswd"; forgetpasswd(ok); break; case "forgetpasswd1"; forgetpasswd1(); break; endswitch; /* end of switch */ include($_SERVER[DOCUMENT_ROOT]."/locator/footer.htm"); ?>