Your IP : 216.73.216.26


Current Path : /home2/wtmwscom/www/member/
Upload File :
Current File : /home2/wtmwscom/www/member/forgot_transaction_password_model.php

<?php 
session_start();
include '../connection.php';
include '../function_lib.php';
$uid = $_SESSION['userid'];
$sent_by = $_POST['sent_by'];
$result = mysqli_query($connection, "SELECT uid, login_id, name, transaction_password, email, mobile FROM user WHERE uid='".$uid."'");
if(mysqli_num_rows($result)){
    $row = mysqli_fetch_object($result);
    if($sent_by=='e'){
        $to = $row->email;
        $subject = "Forgot Transaction Password";
        $message = "
            <b>User Id:</b> ".$row->login_id."<br><br>
            <b>Transaction Password:</b> ".$row->transaction_password."
            ";

        // Always set content-type when sending HTML email
        $headers = "MIME-Version: 1.0" . "\r\n";
        $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
        // More headers
        $headers .= 'From: <info@mindspace>' . "\r\n";
        if(mail($to,$subject,$message,$headers)){
            setMessage('Your transaction password sent to your email inbox.','alert-msg success');
        }
        else{
            setMessage('Some error occured.','alert-msg error');
        }
    }
    else {
        /* For send SMS */
        
        $uid = $row->uid;
        $login_id = $row->login_id;
        $password = $row->transaction_password;
        $name = $row->name;
        $mobile = $row->mobile;
        
        $msg="Dear $name, Your Id no. is $login_id and password is $password Visit us on www.mindspace";
        send_sms($mobile, $msg);
        
        setMessage('Your transaction password sent to your mobile number.','alert-msg success');
    }
}
else{
    setMessage('User id is incorrect.','alert-msg error');
}
redirect('./forgot_transaction_password.php');
?>