How to store password in MYSQL ?
i created the new page,
index.html
<form action="calc.php" method="POST">
Username: <input type="text" name="username">
Password: <input type="password" name="password">
<input type="submit" name="submit" value="Submit">
</form>
and clac.php,
<?php
$username = $_POST['username'];
$pass = $_POST['password'];
if ($username == "a" && $pass =="abc")
/* here i set the password to "abc" */
{
echo 'Welcome to the Page';
echo '<a href="cp.html">Change Pass</a>';
}
else
echo "Wrong";
?>
and here is cp.html,
<form method="POST">
<input type="password" name="newpassword">
<input type="submit" name="submit">
</form>
i want to store that password in mysql and when a users clicks on change password and entered new password then the old password shoukld be replace by old password in mysql and it automatically set to the default value of password. , how can i do this ?
i am newbie in php and don't know how to store something in MYSQL