What's new

Help Php gadz pasok i need ur help!

ginulo mo lalo

PHP:
<?php

if ($row) {
    $result = mysqli_query($conn, "SELECT question, ans FROM users WHERE email = '" .$email." ' ");

    $right_question = "";
    $right_answer = "";
    while ($row = mysqli_fetch_array($result)) {
        if ($row["question"] == $_POST['question']) {
            $right_question = $row["question"];
            $right_answer = $row["ans"];
        }
    }

    if ($right_answer == $_POST['ans']) {
       // send email
    }
}
PHP:
if($row)
  {
    
    if ($row) {
      $result = mysqli_query($conn, "SELECT question, ans FROM users WHERE email = '" .$email." ' ");
 
      $right_question = "";
      $right_answer = "";
      while ($row = mysqli_fetch_array($result)) {
          if ($row["question"] == $_POST['question']) {
              $right_question = $row["question"];
              $right_answer = $row["ans"];
          }
      
 
      if ($right_answer == $_POST['ans']) {
      }
  }
nagsesend paps kaso nga lang yong kahit mali sec ques at answer nagsesend parin.
 
baka nakatakda talga sakin na di na e embed to paps sakit sa ulo pati ikaw nadadamay HAHAHAHAHAHAHAHAHA
 
PHP:
if($row)
  {
   
    if ($row) {
      $result = mysqli_query($conn, "SELECT question, ans FROM users WHERE email = '" .$email." ' ");
 
      $right_question = "";
      $right_answer = "";
      while ($row = mysqli_fetch_array($result)) {
          if ($row["question"] == $_POST['question']) {
              $right_question = $row["question"];
              $right_answer = $row["ans"];
          }
     
 
      if ($right_answer == $_POST['ans']) {
      }
  }
nagsesend paps kaso nga lang yong kahit mali sec ques at answer nagsesend parin.
PHP:
<?php

if ($row) {
    $result = mysqli_query($conn, "SELECT question, ans FROM users WHERE email = '" .$email." ' ");

    $right_question = "";
    $right_answer = "";
    while ($row = mysqli_fetch_array($result)) {
        if ($row["question"] == $_POST['question']) {
            $right_question = $row["question"];
            $right_answer = $row["ans"];
        }
    }
    echo "db question: $right_question<br>";
    echo "db ans: $right_answer<br>";
    echo "<br><br>";
    echo "user q "+$_POST['question'];
    echo "user a "+ $_POST['ans'];
    if ($right_answer == $_POST['ans']) {
        // send email
    }
}

tas ss nung output sa browser
 
send mo nga full source ng file nayan
ganto yong pinapagawa mo paps.
PHP:
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
session_start();
if(isset($_POST['password-reset-tokensqa']) && $_POST['email'])
{
  include 'db_connect.php';
    
    $email = $_POST['email'];
    $password = 'password';
 
    $result = mysqli_query($conn,"SELECT * FROM users WHERE email='" . $email . "'");
 
    $row= mysqli_fetch_array($result);
 
  if($row)
  {
    
    $result = mysqli_query($conn, "SELECT question, ans FROM users WHERE email = '" .$email." ' ");

    $right_question = "";
    $right_answer = "";
    while ($row = mysqli_fetch_array($result)) {
        if ($row["question"] == $_POST['question']) {
            $right_question = $row["question"];
            $right_answer = $row["ans"];
        }
    }
    echo "db question: $right_question<br>";
    echo "db ans: $right_answer<br>";
    echo "<br><br>";
    echo "user q "+$_POST['question'];
    echo "user a "+ $_POST['ans'];
    if ($right_answer == $_POST['ans']) {
        // send email
    }
}
    

    

     $token = md5($email).rand(10,9999);
 
     $expFormat = mktime(
     date("H"), date("i"), date("s"), date("m") ,date("d")+1, date("Y")
     );
 
    $expDate = date("Y-m-d H:i:s",$expFormat);
 
    $update = mysqli_query($conn,"UPDATE users set  password ='" . md5($password) . "', reset_link_token='" . $token . "' ,exp_date='" . $expDate . "' WHERE email='" . $email . "'");
 
    $link = "<a href='cms/reset-password.php?key=".$email."&token=".$token."'>Click to Reset password</a>";
 
    require_once('fpwvendor/autoload.php');
 
    $mail = new PHPMailer(true);
 
    $mail->CharSet =  "utf-8";
    $mail->IsSMTP();
    // enable SMTP authentication
    $mail->SMTPAuth = true;                 
    // GMAIL username
    $mail->Username = "xx";
    // GMAIL password
    $mail->Password = "xxx";
    $mail->SMTPSecure = "ssl"; 
    // sets GMAIL as the SMTP server
    $mail->Host = "smtp.gmail.com";
    // set the SMTP port for the GMAIL server
    $mail->Port = "465";
    $mail->From='xx';
    $mail->FromName='Luck-buy : Courier ';
    $mail->AddAddress($email);
    $mail->Subject  =  'Reset Password';
    $mail->IsHTML(true);
    $mail->Body    = 'Hello there '.$email.', <br><br><br><br> Click on the Link below to Reset Password <br><br><br> '.$link.'';
    if($mail->Send())
    {
      $_SESSION['email']="We've sent you a reset password in your gmail account - ".$email."" ;
      header( "refresh:1;url=forget-password_sq.php" );
    
    }
    else
    {
      echo "Mail Error - >".$mail->ErrorInfo;
    }
  }else{
    $_SESSION['error']="Something went wrong! Please check your SQ and Answer Carefully. - ".$email." ";
    // header( "refresh:1;url=forget-password_sq.php" );
   }
  }else{
    $_SESSION['error']="Invalid Email Address Please check carefully ".$email."";
    header( "refresh:1;url=forget-password_sq.php" );
  }

}
?>
 
ganto yong pinapagawa mo paps.
PHP:
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
session_start();
if(isset($_POST['Pásswørd-reset-tokensqa']) && $_POST['email'])
{
  include 'db_connect.php';
   
    $email = $_POST['email'];
    $Pásswørd = 'Pásswørd';
 
    $result = mysqli_query($conn,"SELECT * FROM users WHERE email='" . $email . "'");
 
    $row= mysqli_fetch_array($result);
 
  if($row)
  {
   
    $result = mysqli_query($conn, "SELECT question, ans FROM users WHERE email = '" .$email." ' ");

    $right_question = "";
    $right_answer = "";
    while ($row = mysqli_fetch_array($result)) {
        if ($row["question"] == $_POST['question']) {
            $right_question = $row["question"];
            $right_answer = $row["ans"];
        }
    }
    echo "db question: $right_question<br>";
    echo "db ans: $right_answer<br>";
    echo "<br><br>";
    echo "user q "+$_POST['question'];
    echo "user a "+ $_POST['ans'];
    if ($right_answer == $_POST['ans']) {
        // send email
    }
}
   

   

     $token = md5($email).rand(10,9999);
 
     $expFormat = mktime(
     date("H"), date("i"), date("s"), date("m") ,date("d")+1, date("Y")
     );
 
    $expDate = date("Y-m-d H:i:s",$expFormat);
 
    $update = mysqli_query($conn,"UPDATE users set  Pásswørd ='" . md5($Pásswørd) . "', reset_link_token='" . $token . "' ,exp_date='" . $expDate . "' WHERE email='" . $email . "'");
 
    $link = "<a href='cms/reset-Pásswørd.php?key=".$email."&token=".$token."'>Click to Reset Pásswørd</a>";
 
    require_once('fpwvendor/autoload.php');
 
    $mail = new PHPMailer(true);
 
    $mail->CharSet =  "utf-8";
    $mail->IsSMTP();
    // enable SMTP authentication
    $mail->SMTPAuth = true;                
    // GMAIL username
    $mail->Username = "xx";
    // GMAIL Pásswørd
    $mail->Pásswørd = "xxx";
    $mail->SMTPSecure = "ssl";
    // sets GMAIL as the SMTP server
    $mail->Host = "smtp.gmail.com";
    // set the SMTP port for the GMAIL server
    $mail->Port = "465";
    $mail->From='xx';
    $mail->FromName='Luck-buy : Courier ';
    $mail->AddAddress($email);
    $mail->Subject  =  'Reset Pásswørd';
    $mail->IsHTML(true);
    $mail->Body    = 'Hello there '.$email.', <br><br><br><br> Click on the Link below to Reset Pásswørd <br><br><br> '.$link.'';
    if($mail->Send())
    {
      $_SESSION['email']="We've sent you a reset Pásswørd in your gmail account - ".$email."" ;
      header( "refresh:1;url=forget-password_sq.php" );
   
    }
    else
    {
      echo "Mail Error - >".$mail->ErrorInfo;
    }
  }else{
    $_SESSION['error']="Something went wrong! Please check your SQ and Answer Carefully. - ".$email." ";
    // header( "refresh:1;url=forget-password_sq.php" );
   }
  }else{
    $_SESSION['error']="Invalid Email Address Please check carefully ".$email."";
    header( "refresh:1;url=forget-password_sq.php" );
  }

}
?>
1634609742760.png

sobra ata bracket alisin ko dalawa sa baba ng if right_ans
 

Attachments

PHP:
<?php

if ($row) {
    $result = mysqli_query($conn, "SELECT question, ans FROM users WHERE email = '" .$email." ' ");

    $right_question = "";
    $right_answer = "";
    while ($row = mysqli_fetch_array($result)) {
        if ($row["question"] == $_POST['question']) {
            $right_question = $row["question"];
            $right_answer = $row["ans"];
        }
    }
    echo "db question: $right_question<br>";
    echo "db ans: $right_answer<br>";
    echo "<br><br>";
    echo "user q "+$_POST['question'];
    echo "user a "+ $_POST['ans'];
    if ($right_answer == $_POST['ans']) {
        // send email
    }
}

tas ss nung output sa browser
1634609807830.png
 

Attachments

PHP:
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;

session_start();
if (isset($_POST['Pásswørd-reset-tokensqa']) && $_POST['email']) {
    include 'db_connect.php';
    
    $email = $_POST['email'];
    $Pásswørd = 'Pásswørd';
 
    $result = mysqli_query($conn, "SELECT * FROM users WHERE email='" . $email . "'");
 
    $row= mysqli_fetch_array($result);
 
    if ($row) {
        $result = mysqli_query($conn, "SELECT question, ans FROM users WHERE email = '" .$email." ' ");

        $right_question = "";
        $right_answer = "";
        while ($row = mysqli_fetch_array($result)) {
            if ($row["question"] == $_POST['question']) {
                $right_question = $row["question"];
                $right_answer = $row["ans"];
            }
        }
        echo "db question: $right_question<br>";
        echo "db ans: $right_answer<br>";
        echo "<br><br>";
        echo "user q "+$_POST['question'];
        echo "user a "+ $_POST['ans'];
        if ($right_answer == $_POST['ans']) {
            $token = md5($email).rand(10, 9999);
 
            $expFormat = mktime(
                date("H"),
                date("i"),
                date("s"),
                date("m"),
                date("d")+1,
                date("Y")
            );
 
            $expDate = date("Y-m-d H:i:s", $expFormat);
 
            $update = mysqli_query($conn, "UPDATE users set  Pásswørd ='" . md5($Pásswørd) . "', reset_link_token='" . $token . "' ,exp_date='" . $expDate . "' WHERE email='" . $email . "'");
 
            $link = "<a href='cms/reset-Pásswørd.php?key=".$email."&token=".$token."'>Click to Reset Pásswørd</a>";
 
            require_once('fpwvendor/autoload.php');
 
            $mail = new PHPMailer(true);
 
            $mail->CharSet =  "utf-8";
            $mail->IsSMTP();
            // enable SMTP authentication
            $mail->SMTPAuth = true;
            // GMAIL username
            $mail->Username = "xx";
            // GMAIL Pásswørd
            $mail->Pásswørd = "xxx";
            $mail->SMTPSecure = "ssl";
            // sets GMAIL as the SMTP server
            $mail->Host = "smtp.gmail.com";
            // set the SMTP port for the GMAIL server
            $mail->Port = "465";
            $mail->From='xx';
            $mail->FromName='Luck-buy : Courier ';
            $mail->AddAddress($email);
            $mail->Subject  =  'Reset Pásswørd';
            $mail->IsHTML(true);
            $mail->Body    = 'Hello there '.$email.', <br><br><br><br> Click on the Link below to Reset Pásswørd <br><br><br> '.$link.'';
            if ($mail->Send()) {
                $_SESSION['email']="We've sent you a reset Pásswørd in your gmail account - ".$email."" ;
                header("refresh:1;url=forget-password_sq.php");
            } else {
                echo "Mail Error - >".$mail->ErrorInfo;
            }
        } else {
            $_SESSION['error']="Something went wrong! Please check your SQ and Answer Carefully. - ".$email." ";
            // header( "refresh:1;url=forget-password_sq.php" );
        }
    } else {
        $_SESSION['error']="Invalid Email Address Please check carefully ".$email."";
        header("refresh:1;url=forget-password_sq.php");
    }
}
ganto yong pinapagawa mo paps.
PHP:
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
session_start();
if(isset($_POST['Pásswørd-reset-tokensqa']) && $_POST['email'])
{
  include 'db_connect.php';
   
    $email = $_POST['email'];
    $Pásswørd = 'Pásswørd';
 
    $result = mysqli_query($conn,"SELECT * FROM users WHERE email='" . $email . "'");
 
    $row= mysqli_fetch_array($result);
 
  if($row)
  {
   
    $result = mysqli_query($conn, "SELECT question, ans FROM users WHERE email = '" .$email." ' ");

    $right_question = "";
    $right_answer = "";
    while ($row = mysqli_fetch_array($result)) {
        if ($row["question"] == $_POST['question']) {
            $right_question = $row["question"];
            $right_answer = $row["ans"];
        }
    }
    echo "db question: $right_question<br>";
    echo "db ans: $right_answer<br>";
    echo "<br><br>";
    echo "user q "+$_POST['question'];
    echo "user a "+ $_POST['ans'];
    if ($right_answer == $_POST['ans']) {
        // send email
    }
}
   

   

     $token = md5($email).rand(10,9999);
 
     $expFormat = mktime(
     date("H"), date("i"), date("s"), date("m") ,date("d")+1, date("Y")
     );
 
    $expDate = date("Y-m-d H:i:s",$expFormat);
 
    $update = mysqli_query($conn,"UPDATE users set  Pásswørd ='" . md5($Pásswørd) . "', reset_link_token='" . $token . "' ,exp_date='" . $expDate . "' WHERE email='" . $email . "'");
 
    $link = "<a href='cms/reset-Pásswørd.php?key=".$email."&token=".$token."'>Click to Reset Pásswørd</a>";
 
    require_once('fpwvendor/autoload.php');
 
    $mail = new PHPMailer(true);
 
    $mail->CharSet =  "utf-8";
    $mail->IsSMTP();
    // enable SMTP authentication
    $mail->SMTPAuth = true;                
    // GMAIL username
    $mail->Username = "xx";
    // GMAIL Pásswørd
    $mail->Pásswørd = "xxx";
    $mail->SMTPSecure = "ssl";
    // sets GMAIL as the SMTP server
    $mail->Host = "smtp.gmail.com";
    // set the SMTP port for the GMAIL server
    $mail->Port = "465";
    $mail->From='xx';
    $mail->FromName='Luck-buy : Courier ';
    $mail->AddAddress($email);
    $mail->Subject  =  'Reset Pásswørd';
    $mail->IsHTML(true);
    $mail->Body    = 'Hello there '.$email.', <br><br><br><br> Click on the Link below to Reset Pásswørd <br><br><br> '.$link.'';
    if($mail->Send())
    {
      $_SESSION['email']="We've sent you a reset Pásswørd in your gmail account - ".$email."" ;
      header( "refresh:1;url=forget-password_sq.php" );
   
    }
    else
    {
      echo "Mail Error - >".$mail->ErrorInfo;
    }
  }else{
    $_SESSION['error']="Something went wrong! Please check your SQ and Answer Carefully. - ".$email." ";
    // header( "refresh:1;url=forget-password_sq.php" );
   }
  }else{
    $_SESSION['error']="Invalid Email Address Please check carefully ".$email."";
    header( "refresh:1;url=forget-password_sq.php" );
  }

}
?>
 
PHP:
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;

session_start();
if (isset($_POST['Pásswørd-reset-tokensqa']) && $_POST['email']) {
    include 'db_connect.php';
   
    $email = $_POST['email'];
    $Pásswørd = 'Pásswørd';
 
    $result = mysqli_query($conn, "SELECT * FROM users WHERE email='" . $email . "'");
 
    $row= mysqli_fetch_array($result);
 
    if ($row) {
        $result = mysqli_query($conn, "SELECT question, ans FROM users WHERE email = '" .$email." ' ");

        $right_question = "";
        $right_answer = "";
        while ($row = mysqli_fetch_array($result)) {
            if ($row["question"] == $_POST['question']) {
                $right_question = $row["question"];
                $right_answer = $row["ans"];
            }
        }
        echo "db question: $right_question<br>";
        echo "db ans: $right_answer<br>";
        echo "<br><br>";
        echo "user q "+$_POST['question'];
        echo "user a "+ $_POST['ans'];
        if ($right_answer == $_POST['ans']) {
            $token = md5($email).rand(10, 9999);
 
            $expFormat = mktime(
                date("H"),
                date("i"),
                date("s"),
                date("m"),
                date("d")+1,
                date("Y")
            );
 
            $expDate = date("Y-m-d H:i:s", $expFormat);
 
            $update = mysqli_query($conn, "UPDATE users set  Pásswørd ='" . md5($Pásswørd) . "', reset_link_token='" . $token . "' ,exp_date='" . $expDate . "' WHERE email='" . $email . "'");
 
            $link = "<a href='cms/reset-Pásswørd.php?key=".$email."&token=".$token."'>Click to Reset Pásswørd</a>";
 
            require_once('fpwvendor/autoload.php');
 
            $mail = new PHPMailer(true);
 
            $mail->CharSet =  "utf-8";
            $mail->IsSMTP();
            // enable SMTP authentication
            $mail->SMTPAuth = true;
            // GMAIL username
            $mail->Username = "xx";
            // GMAIL Pásswørd
            $mail->Pásswørd = "xxx";
            $mail->SMTPSecure = "ssl";
            // sets GMAIL as the SMTP server
            $mail->Host = "smtp.gmail.com";
            // set the SMTP port for the GMAIL server
            $mail->Port = "465";
            $mail->From='xx';
            $mail->FromName='Luck-buy : Courier ';
            $mail->AddAddress($email);
            $mail->Subject  =  'Reset Pásswørd';
            $mail->IsHTML(true);
            $mail->Body    = 'Hello there '.$email.', <br><br><br><br> Click on the Link below to Reset Pásswørd <br><br><br> '.$link.'';
            if ($mail->Send()) {
                $_SESSION['email']="We've sent you a reset Pásswørd in your gmail account - ".$email."" ;
                header("refresh:1;url=forget-password_sq.php");
            } else {
                echo "Mail Error - >".$mail->ErrorInfo;
            }
        } else {
            $_SESSION['error']="Something went wrong! Please check your SQ and Answer Carefully. - ".$email." ";
            // header( "refresh:1;url=forget-password_sq.php" );
        }
    } else {
        $_SESSION['error']="Invalid Email Address Please check carefully ".$email."";
        header("refresh:1;url=forget-password_sq.php");
    }
}
run q to paps?
 
ayusin mo nga naming mo may mga nag same name tulad ng $row and $result

maya na pasok pa ako
 
sige paps hahahah
PHP:
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;

session_start();
if (isset($_POST['Pásswørd-reset-tokensqa']) && $_POST['email']) {
    include 'db_connect.php';
    
    $email = $_POST['email'];
    $Pásswørd = 'Pásswørd';
 
    $result = mysqli_query($conn, "SELECT * FROM users WHERE email='" . $email . "'");
 
    $row= mysqli_fetch_array($result);
 
    if ($row) {
        $result = mysqli_query($conn, "SELECT question, ans FROM users WHERE email = '" .$email." ' ");

        $right_question = "";
        $right_answer = "";
        while ($row = mysqli_fetch_array($result)) {
            if ($row["question"] == $_POST['question']) {
                $right_question = $row["question"];
                $right_answer = $row["ans"];
            }
        }
        echo "db question: $right_question<br>";
        echo "db ans: $right_answer<br>";
        echo "<br><br>";
        echo "user q ".$_POST['question'];
        echo "user a ". $_POST['ans'];
        if ($right_answer == $_POST['ans']) {
            $token = md5($email).rand(10, 9999);
 
            $expFormat = mktime(
                date("H"),
                date("i"),
                date("s"),
                date("m"),
                date("d")+1,
                date("Y")
            );
 
            $expDate = date("Y-m-d H:i:s", $expFormat);
 
            $update = mysqli_query($conn, "UPDATE users set  Pásswørd ='" . md5($Pásswørd) . "', reset_link_token='" . $token . "' ,exp_date='" . $expDate . "' WHERE email='" . $email . "'");
 
            $link = "<a href='cms/reset-Pásswørd.php?key=".$email."&token=".$token."'>Click to Reset Pásswørd</a>";
 
            require_once('fpwvendor/autoload.php');
 
            $mail = new PHPMailer(true);
 
            $mail->CharSet =  "utf-8";
            $mail->IsSMTP();
            // enable SMTP authentication
            $mail->SMTPAuth = true;
            // GMAIL username
            $mail->Username = "xx";
            // GMAIL Pásswørd
            $mail->Pásswørd = "xxx";
            $mail->SMTPSecure = "ssl";
            // sets GMAIL as the SMTP server
            $mail->Host = "smtp.gmail.com";
            // set the SMTP port for the GMAIL server
            $mail->Port = "465";
            $mail->From='xx';
            $mail->FromName='Luck-buy : Courier ';
            $mail->AddAddress($email);
            $mail->Subject  =  'Reset Pásswørd';
            $mail->IsHTML(true);
            $mail->Body    = 'Hello there '.$email.', <br><br><br><br> Click on the Link below to Reset Pásswørd <br><br><br> '.$link.'';
            if ($mail->Send()) {
                $_SESSION['email']="We've sent you a reset Pásswørd in your gmail account - ".$email."" ;
                header("refresh:1;url=forget-password_sq.php");
            } else {
                echo "Mail Error - >".$mail->ErrorInfo;
            }
        } else {
            $_SESSION['error']="Something went wrong! Please check your SQ and Answer Carefully. - ".$email." ";
            // header( "refresh:1;url=forget-password_sq.php" );
        }
    } else {
        $_SESSION['error']="Invalid Email Address Please check carefully ".$email."";
        header("refresh:1;url=forget-password_sq.php");
    }
}

try mo to may mali pala ako sorry
 
PHP:
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;

session_start();
if (isset($_POST['Pásswørd-reset-tokensqa']) && $_POST['email']) {
    include 'db_connect.php';
   
    $email = $_POST['email'];
    $Pásswørd = 'Pásswørd';
 
    $result = mysqli_query($conn, "SELECT * FROM users WHERE email='" . $email . "'");
 
    $row= mysqli_fetch_array($result);
 
    if ($row) {
        $result = mysqli_query($conn, "SELECT question, ans FROM users WHERE email = '" .$email." ' ");

        $right_question = "";
        $right_answer = "";
        while ($row = mysqli_fetch_array($result)) {
            if ($row["question"] == $_POST['question']) {
                $right_question = $row["question"];
                $right_answer = $row["ans"];
            }
        }
        echo "db question: $right_question<br>";
        echo "db ans: $right_answer<br>";
        echo "<br><br>";
        echo "user q ".$_POST['question'];
        echo "user a ". $_POST['ans'];
        if ($right_answer == $_POST['ans']) {
            $token = md5($email).rand(10, 9999);
 
            $expFormat = mktime(
                date("H"),
                date("i"),
                date("s"),
                date("m"),
                date("d")+1,
                date("Y")
            );
 
            $expDate = date("Y-m-d H:i:s", $expFormat);
 
            $update = mysqli_query($conn, "UPDATE users set  Pásswørd ='" . md5($Pásswørd) . "', reset_link_token='" . $token . "' ,exp_date='" . $expDate . "' WHERE email='" . $email . "'");
 
            $link = "<a href='cms/reset-Pásswørd.php?key=".$email."&token=".$token."'>Click to Reset Pásswørd</a>";
 
            require_once('fpwvendor/autoload.php');
 
            $mail = new PHPMailer(true);
 
            $mail->CharSet =  "utf-8";
            $mail->IsSMTP();
            // enable SMTP authentication
            $mail->SMTPAuth = true;
            // GMAIL username
            $mail->Username = "xx";
            // GMAIL Pásswørd
            $mail->Pásswørd = "xxx";
            $mail->SMTPSecure = "ssl";
            // sets GMAIL as the SMTP server
            $mail->Host = "smtp.gmail.com";
            // set the SMTP port for the GMAIL server
            $mail->Port = "465";
            $mail->From='xx';
            $mail->FromName='Luck-buy : Courier ';
            $mail->AddAddress($email);
            $mail->Subject  =  'Reset Pásswørd';
            $mail->IsHTML(true);
            $mail->Body    = 'Hello there '.$email.', <br><br><br><br> Click on the Link below to Reset Pásswørd <br><br><br> '.$link.'';
            if ($mail->Send()) {
                $_SESSION['email']="We've sent you a reset Pásswørd in your gmail account - ".$email."" ;
                header("refresh:1;url=forget-password_sq.php");
            } else {
                echo "Mail Error - >".$mail->ErrorInfo;
            }
        } else {
            $_SESSION['error']="Something went wrong! Please check your SQ and Answer Carefully. - ".$email." ";
            // header( "refresh:1;url=forget-password_sq.php" );
        }
    } else {
        $_SESSION['error']="Invalid Email Address Please check carefully ".$email."";
        header("refresh:1;url=forget-password_sq.php");
    }
}

try mo to may mali pala ako sorry
1634610496476.png
 

Attachments

kitams kaya ayaw mag success kasi nga hindi ma fetch yung data sa db ewan ko kung baket

PHP:
        while ($row = mysqli_fetch_array($result)) {
           
                var_dump($row); // add mo to
                echo "<br>"; // add mo to
            if ($row["question"] == $_POST['question']) {
                $right_question = $row["question"];
                $right_answer = $row["ans"];
            }
        }
PHP:
$result = mysqli_query($conn, "SELECT question, ans FROM users WHERE email = '" .$email." ' ");

    $right_question = "";
    $right_answer = "";
    while ($row = mysqli_fetch_array($result)) {
          var_dump($row);
          echo "<br>";
        if ($row["question"] == $_POST['question']) {
            $right_question = $row["question"];
            $right_answer = $row["ans"];
        }
    }
    echo "db question: $right_question<br>";
    echo "db ans: $right_answer<br>";
    echo "<br><br>";
    echo "user q ".$_POST['question'];
    echo "user a ". $_POST['ans'];
    if ($right_answer == $_POST['ans']) {

output :

1634611622032.png
 

Attachments

pasok ka muna paps pero ok lang if hindi maayos to dq nalang siguro e embed kaso, ayon nga lang na suggest kasi ng panel hahahah umay
 

Similar threads

Back
Top