Having difficulty with PHP forgotten password link -


hi have forgotten password script in when user clicks email link , sends password reset page. once clicked goes desired page, there problem both send forms come up. have forgotten password file well. if you've seen picture, that's coming up. bit new php. want show new password , confirm new password form.

https://www.dropbox.com/s/y2qhxovodk3rlrv/2015-07-15_0814.png?dl=0

the script:

<div class="container">      <div class="row">     <?php  require_once 'connection.php';  if (isset($_get['code']))  { $get_username = $_get['username']; $get_code = $_get['code']; $query = mysqli_query($connection,"select * user_tbl username='$get_username'");  while ($row1s = mysqli_fetch_assoc($query))  {  $db_code= $row1s['passreset'];  $db_username= $row1s['username']; } if ($get_username == $db_username && $get_code == $db_code )  {     echo "      <form action='forgotpassword_process.php' method='post'>              <legend><h1 style='color:red;'>forgot password</h1></legend><br>              <div class='input-field col s6'>                  <div class='form-group'>                      <span class='help-block'>enter new password</span>                      <input type='password' name='newpass' class='form-control' placeholder='new password '>                  </div>              </div>             <div class='input-field col s6'>                  <div class='form-group'>                      <span class='help-block'>re-enter password  </span><br>                      <input type='password' name='password1' class='form-control' placeholder='password'>                  </div>              </div>               <input type='submit' name='submit' class='btn' value='update password' />             <input type='hidden' name='username' class='btn' value='$db_username' />           </form>         ";     }   }   ?>       <form action="forgotpassword_process.php" method="post">              <legend><h1 style="color:red;">forgot password</h1></legend><br>              <div class="input-field col s6">                  <div class="form-group">                      <span class="help-block">enter username</span>                      <input type="text" name="username" class="form-control" placeholder="user name">                  </div>              </div>             <div class="input-field col s6">                  <div class="form-group">                      <span class="help-block">enter email </span><br>                      <input type="text" name="email" class="form-control" placeholder="password">                  </div>              </div>               <input type="submit" name="submit" class="btn" value="submit" />           </form>      </div>  </div> 

before second form can add else condition,

<div class="container">      <div class="row">     <?php  require_once 'connection.php';  if (isset($_get['code']))  {   $get_username = $_get['username'];   $get_code = $_get['code'];   $query = mysqli_query($connection,"select * user_tbl username='$get_username'");  while ($row1s = mysqli_fetch_assoc($query))  {  $db_code= $row1s['passreset'];  $db_username= $row1s['username']; } if ($get_username == $db_username && $get_code == $db_code )  {     echo "      <form action='forgotpassword_process.php' method='post'>              <legend><h1 style='color:red;'>forgot password</h1></legend><br>              <div class='input-field col s6'>                  <div class='form-group'>                      <span class='help-block'>enter new password</span>                      <input type='password' name='newpass' class='form-control' placeholder='new password '>                  </div>              </div>             <div class='input-field col s6'>                  <div class='form-group'>                      <span class='help-block'>re-enter password  </span><br>                      <input type='password' name='password1' class='form-control' placeholder='password'>                  </div>              </div>               <input type='submit' name='submit' class='btn' value='update password' />             <input type='hidden' name='username' class='btn' value='$db_username' />         </form>     ";     } } else { ?>     <form action="forgotpassword_process.php" method="post">              <legend><h1 style="color:red;">forgot password</h1></legend><br>              <div class="input-field col s6">                  <div class="form-group">                      <span class="help-block">enter username</span>                      <input type="text" name="username" class="form-control" placeholder="user name">                  </div>              </div>             <div class="input-field col s6">                  <div class="form-group">                      <span class="help-block">enter email </span><br>                      <input type="text" name="email" class="form-control" placeholder="password">                  </div>              </div>               <input type="submit" name="submit" class="btn" value="submit" />           </form>      </div>  </div> <?php    } // end else  ?> 

Comments