What's new

Help Php gadz pasok i need ur help!

Vscode tas plugin prettier 😇
1634560341890.png

eto paps?
 

Attachments

matuto ka mag debug para ma solve mo ganyan problem

isa isahin mo pinaka ugat ng problema

after mo ilagay tamang ans error lumabas

ang respo ay base dito

}else{
$_SESSION['error']="Something went wrong! ";
header( "refresh:1;url=forget-password_sq.php" );
}

so isipin mo bakit dyan napunta?

meaning yung if nya hindi success

so taas nun mag echo ka para malaman mo ano ba value sa db kaya nag kakaganun

so dito yun

if (($ques == $ansq1) && ($ans == $ansan2)) {

ang gawin mo sa taas nyan mag lagay ka ng

echo "ques from db = $ques ";
echo "answer from db = $ansq1";

echo "ques from user = $ans ";
echo "ques from db = $ansan2";

ngayon malalaman mo bakit ayaw mag success🙂

so base sa akin pag basa sa code ang mali mo ay
while ($row = mysqli_fetch_array($result)) {
$ques = $row["question"];
$ans = $row["ans"];
}
if (($ques == $ansq1) && ($ans == $ansan2)) {

dapat


while{ blablabla
if($row["question"] == $question_from_user) {
$right_question = $row["question"];
$right_answer = $row["ans"];
}
}

if($right_answer == $answer_from_user)

try it:)


btw wag ka gagamit ng $ans1 $ans2 ang sakit kasi sa utak nakakalito

ayusin mo pag pangalan😄
ganto gusto mo sabihin paps?
PHP:
if($row)
  {
    
    $result = mysqli_query($conn, "SELECT question, ans FROM users WHERE email = '" .$email." ' ");

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

  
     if ($right_answer == $answer_from_user) {
 
ganto gusto mo sabihin paps?
PHP:
if($row)
  {
   
    $result = mysqli_query($conn, "SELECT question, ans FROM users WHERE email = '" .$email." ' ");

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

 
     if ($right_answer == $answer_from_user) {
1634566868033.png

y undefined paps nilagay naman
 

Attachments

ganto gusto mo sabihin paps?
PHP:
if($row)
  {
   
    $result = mysqli_query($conn, "SELECT question, ans FROM users WHERE email = '" .$email." ' ");

     $question_from_user = "";// right ques dapat to
     $answer_from_user = ""; // right ans dapat to
   
     while ($row = mysqli_fetch_array($result)) {
      if($row["question"] == $question_from_user) {
        $right_question = $row["question"];
        $right_answer = $row["ans"];
        }
        }

 
     if ($right_answer == $answer_from_user) {
 
Naka set naba sa ques from user = $_POST['question']?

Kung hindi pa sa if mo dapat

If right questions == $_POST['question']
If right ans == $_POST['answer']
 
Naka set naba sa ques from user = $_POST['question']?

Kung hindi pa sa if mo dapat

If right questions == $_POST['question']
If right ans == $_POST['answer']
ganto ba paps?
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"] == $question_from_user) {
        $right_question = $row["question"];
        $right_answer = $row["ans"];
        }
        }

        
        if(($right_answer == $_POST['question']) && ($right_question == $_POST['ans'])) {
 
ganto ba paps?
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"] == $question_from_user) {
        $right_question = $row["question"];
        $right_answer = $row["ans"];
        }
        }

      
        if(($right_answer == $_POST['question']) && ($right_question == $_POST['ans'])) {


if($right_answer == $_POST['ans']){ nalang

Tas yung nasa loob ng while na if

if($row["question"] == $_POST['question']) {
 
if($right_answer == $_POST['ans']){ nalang

Tas yung nasa loob ng while na if

if($row["question"] == $_POST['question']) {
hindi tumutuloy paps di nagsesend pero lumalabas yong error parang ganon kay lods joemar.

1634607895111.png


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']) && ($right_question == $_POST['question']))
 

Attachments

hindi tumutuloy paps di nagsesend pero lumalabas yong error parang ganon kay lods joemar.

View attachment 1674000

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']) && ($right_question == $_POST['question']))
pero tama na input ko same sa nasa db
 
oks pag ganto paps, nasesend yong reset pw sa gmail at the same time pag mali yong sec ques or ans nalabas error na something went wrong. ok na kaya to? HHAHAHAHAHA try ko muna if mareset pw

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

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

        
        if(($right_answer == $_POST['ans']) && ($right_question == $_POST['question']))
 
oks pag ganto paps, nasesend yong reset pw sa gmail at the same time pag mali yong sec ques or ans nalabas error na something went wrong. ok na kaya to? HHAHAHAHAHA try ko muna if mareset pw

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

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

      
        if(($right_answer == $_POST['ans']) && ($right_question == $_POST['question']))
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
    }
}
 
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']) {
    }
}
ay hahahah suri paps try ko to
 

Similar threads

Back
Top