不确定错误是什么代码

时间:2014-11-13 02:47:28

标签: php

我一直致力于使用数据库中的变量(例如他们的密码)来更改数据库中某人的密码(例如,如果他们忘记了代码)。

每当我尝试运行该函数时,我总是会收到此错误:解析错误:语法错误,第70行的C:\ xampp \ htdocs \ PhysicsProject \ resetPasswordConnection.php中的文件意外结束。

以下是导致错误的代码:

   <?php
include ('inc/header.php');


$userUsername1 = $_POST['userUsername'];
$userChangePassword = md5($_POST['userChangePassword']);
$userChangePasswordConfirm = md5($_POST['userChangePasswordConfirm']);
$userSecretCode = md5($_POST['userSecretCode']);
$sql4 = "SELECT * FROM userinformation WHERE user_username = '" . $userUsername1 . "'";

$data2 = mysql_query($sql4, $cn) or
  die (mysql_error($cn));
$rowPW = mysql_num_rows($data2);
$row1214 = mysql_fetch_assoc($data2);
$DBuName = $row1214['user_username'];
$DBCode = $row1214['user_code'];

  if ($userUsername1 == $DBuName){
    if ($userSecretCode == $DBCode){  
      if ($rowPW == 1){
        if ($userChangePassword != $userChangePasswordConfirm){?>
          <div class = "container" id = "bodyContainerVideo">
            <div class = "row">
              <div class = "col-md-12">
                <h1 class = "Main-Title">Your new passwords do not match.</h1>
              </div>
            </div>
          </div>
        </body>
      </html><?php 
  } else {
      $sql5 = "UPDATE userinformation SET user_password = '" . $userChangePassword . "' WHERE user_username = '" . $userUsername1 . "'";
          $result5 = mysql_query($sql7, $cn) or
          die(mysql_error($cn));?>
    <div class = "container" id = "bodyContainerVideo">
      <div class = "row">
        <div class = "col-md-12">
          <h1 class = "Main-Title">Your password has been sucessfully been changed</h1>
        </div>
      </div>
    </div>
  </body>
</html>
<?php
      }
    } else {?>
    <div class = "container" id = "bodyContainerVideo">
      <div class = "row">
        <div class = "col-md-12">
          <h1 class = "Main-Title">The code that you put in is incorrect</h1>
        </div>
      </div>
    </div>
  </body>
</html>
    <?php}
  } else {?>
    <div class = "container" id = "bodyContainerVideo">
      <div class = "row">
        <div class = "col-md-12">
          <h1 class = "Main-Title">Username does not exist.</h1>
        </div>
      </div>
    </div>
  </body>
</html>  
  <?php }
  } 
include ('inc/footer.php');
?>

有人可以帮帮我吗?

1 个答案:

答案 0 :(得分:0)

更改此项(应为第58行):

<?php}

到此(你只需要1个空格):

<?php  //this also works <?php } but this not <?php}
}