I have the following code and I get the following error
<?php$user=$_SESSION['MM_Username'];if($user){//userisloggedinif($_POST['submit']){//startchangingpassword$oldpassword=md5($_POST['senha_atual']);$newpassword=md5($_POST['senha_nova']);$repeatnewpassword=md5($_POST['confirme_senha']);//checkpasswordagainstdb//connectdbmysql_select_db($database_bvmarco,$bvmarco);$query_password=sprintf("SELECT password FROM login WHERE numMec = '$user'");
$password = mysql_query($query_password, $bvmarco) or die(mysql_error());
$row_password = mysql_fetch_assoc($password);
$totalRows_password = mysql_num_rows($password);
$oldpassworddb=$row_password['password'];
//check password
if($oldpassword==$oldpassworddb){
//chek new passwords
if($newpassword==$repeatnewpassword){
//success
//change password in db
$querychange = mysql_query("UPDATE login SET password='$newpassword' WHERE numMec = '$user'");
session_destroy();
die("Password alterada com sucesso!");
}else{
die("As password's não são iguais");
}
}else{
die("A password atual não bate certo");
}
}else{
echo"<div class='card-body'>
<form METHOD='POST' name='password'>
<div class='align-items-center justify-content-center'>
<div class='form-group'>
<label><b>Antiga password</b></label>
<input type='text' placeholder='Antiga password' name='senha_atual' class='form-control'>
</div>
<div class='form-group'>
<label for='tipo'><b>Nova password</b></label>
<input type='text' placeholder='Nova password' name='senha_nova' class='form-control''>
<label for='tipo'><b>Confirme password</b></label>
<input type='text' placeholder='Nova password' name='confirme_senha' class='form-control'>
</div>
<input type='submit' name='submit' id='submt' value='Change password'>
</div>
</form>
</div>";
}
}else{
die("Precisas fazer o login para mudar a password!");
}
?>