title: get result in same page and form
body: <p>hello i have simple problem with my functions there is 2 codes : </p>
  
  <p>i need when i put the right input answer echo $row['answer']; and sucess in next code.</p>
  
  <p>it means i need when $_POST['answer'] = $row['answer']; echo my password</p>
  
  <p>can someone help me with if cond.</p>
  
  <p>this code is working perfect :</p>
  
  <pre><code>&lt;?php 
  
  
  $username = $_POST['username']; 
  
  
  include('config.php');
  $result = mysqli_query($con,"SELECT * FROM persons WHERE username='$username'");
  
  while($row = mysqli_fetch_array($result)){
  
  echo $row['username'];
  echo "&lt;/br&gt;";
  echo "&lt;/br&gt;";
  echo "&lt;p&gt;&lt;b&gt;Secret Question&lt;/b&gt;&lt;/p&gt;";
  echo $row['secret'];
  $freeanswer = $row['answer'];
  }  
  ?&gt;
  </code></pre>
  
  <p>code problem in same page : </p>
  
  <pre><code>&lt;/br&gt;
  &lt;/br&gt;
  &lt;form action="" method="POST"&gt;
  &lt;p&gt;&lt;b&gt;Answer is :&lt;/b&gt;&lt;p&gt;
  &lt;input type="text" name="answer"&gt;
  &lt;/br&gt;
  &lt;/br&gt;
  &lt;input type="Submit" value="Submit"&gt;
  &lt;/form&gt;
  &lt;/div&gt;
  
   &lt;?php 
  $anme = $_POST['answer'];
  if ($anme==$freeanswer) {
  echo "sucess"; 
  } else {
  echo "wrong";
  }
  
  ?&gt;
  </code></pre>