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, " $snemail
Power by yavip.com networks
"; echo "
"; } else { /* id not existed */ forgetpasswd($fgtpassid=notexisted); } }; /* forgetpasswd1 */ Function forgetpasswd($fgtpassid) { global $conn; echo "
"; if($fgtpassid=="notexisted") { echo "! The user ID $enteruserid entered was not a valid ID. You may re-enter your user ID again. | "; echo "
"); 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, " $snemail
Power by yavip.com networks
";
/********/
echo "
"; } $yahoopos = strpos($userid, 'yahoo.com'); if ($yahoopos !== false) { echo " "; } $hotmailpos = strpos($userid, 'hotmail.com'); if ($hotmailpos !== false) { echo " "; } $aolpos = strpos($userid, 'aol.com'); if ($aolpos !== false) { echo " "; } /*******/ echo " | ";
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 "
"; ///////// 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"); ?>