include("../class/DBfunction.php"); ?>
include("./class/sfunction.php"); ?>
$fg=true;
$text='';
if (isset($_POST['email']) && !empty($_POST['email']) ) {
$regex = '/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*(\.[a-zA-Z]{2,3})$/';
if (!(preg_match($regex, $_POST['email']))) {
$fg = false;
}
}else{
$fg=false;
}
if (isset($_POST['send']) && $fg) {
$msg_style = '';
$msg_table = '';
$db = new DB();
$db->connectDB();
date_default_timezone_set('Asia/Bangkok');
$sql="select * from member where email='".$_POST['email']."' and status='1'";
$result = $db->mysqli->query($sql);
if(isset($result->num_rows)&& !empty($result->num_rows)){
$row = $result->fetch_row();
$result->close();
//die(var_dump($row));
$email = $row[4];
$pass = $row[6];
$msg_table .= '
ID (Your e-mail) : '.$email.'
Password : '.$pass.'
';
$msg_table_footer = '
Password has been sent to your mail.
'; //exit(); } else { header('Content-Type: text/html; charset=utf-8'); echo $body . 'Password has sent to your mail.
'; /*echo '';*/ exit(0); exit(); } header("refresh:0;url=login.php"); die(); }else{//not found in record $text = 'Email '.$_POST['email'].' not found.
'; //$text .= $sql; } } ?>In case that you forgot your password, we can resend it to you.