Hello,
I'm trying to show the form once its been submitted it hides the form and shows the echo message instead of it showing the messages aboce the text boxes is this possable?
PHP Code:
<?php include('styles/top.php'); ?>
<div id="left">
<img src="images/john.png" height="600px" width="300px" />
</div>
<div id="right">
<div id="view_box">
<ul>
<li><img src="images/1.png" /></li>
<!-- <li><img src="pics/2.jpg" /></li> -->
<!-- <li><img src="pics/3.jpg" /></li> -->
</ul>
</div>
<div id="button">
<ul>
<!-- <li><button class="button" scroll_value="0">*</button></li> -- >
<!-- <li><button class="button" scroll_value="600">*</button></li> -->
<!-- <li><button class="button" scroll_value="1200">*</button></li> -->
</ul>
</div>
<hr />
<?php
if (($user_level !=1 && $user_level !=2)){
echo "
Coming Soon
";
} else {
if(isset($_POST['update']))
{
$n_password = md5($_POST['n_password']);
$c_password = md5($_POST['c_password']);
if($c_password === $n_password)
{
$sql="update customers set password='$n_password' where
username='$username'";
$res=mysqli_query($con,$sql);
if($res)
{
//Password Successfully Changed.
echo "Password Has Been Changed";
}
else
{
//Sorry, Something went wrong, Please Try Again.
echo "Sorry, Something went wrong, Please Try Again.";
}
}
else
{
//Password do not Match.
echo "Passwords do not match.";
}
}
?>
<h2>Change Your Password</h2>
<form action="" method="post">
<input type="password"”" name="n_password" placeholder="Enter new username" required>
<input type="password" name="c_password" placeholder="Enter confirm password" required>
<input type="submit" value="Submit" name="update">
</form>
<?php
}
?>
</div>
<?php include('styles/bottom.php'); ?>