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?