<?php 
    session_start();
    include"../../connect/db.php";

    function base64url_encode($data) { 
      return rtrim(strtr(base64_encode($data), '+/', '-_'), '='); 
    } 
   

    if( isset($_POST['account_num']) ){
 
        $account_num = mysqli_real_escape_string($con,$_POST['account_num']);  
        
        
        

        $sql = mysqli_query($con," SELECT * FROM users WHERE account_num = '$account_num' ");

        if( mysqli_num_rows($sql) != 0 ){
            $row = mysqli_fetch_assoc($sql);
            $email = $row['email'];
            $encoded = base64url_encode($email.",israelislookinggood");
            include 'forgetpasswordmail.php';
            echo "success";

        }
        else{
            echo "user dosent exist";
        }

    }
?>        