dongyong1942 2014-11-13 02:47
浏览 19
已采纳

不确定错误是什么代码

I have been working on a code to change someone's password in a database (such as if they forgot their code) using variables from a database such as their secret code.

Whenever I attempt to run the function I always get this error: Parse error: syntax error, unexpected end of file in C:\xampp\htdocs\PhysicsProjectesetPasswordConnection.php on line 70.

Here is the code that is causing the error:

   <?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');
?>

Can someone please help me?

  • 写回答

1条回答 默认 最新

  • douchen1924 2014-11-13 02:58
    关注

    Change this (Should be line 58):

    <?php}
    

    to this (You need just 1 space min.):

    <?php  //this also works <?php } but this not <?php}
    }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮