How To Update a Password In php
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Update password</title>
</head>
<body>
<?php
mysql_connect("localhost","root","");
mysql_select_db("login");
$old=$_REQUEST['pwd'];
$new=$_REQUEST['npwd'];
$cnew=$_REQUEST['cpwd'];
if($new==$cnew)
{
$q="update loginhere set password='$cnew' WHERE password='$old'";
$qu=mysql_query($q);
if($qu)
{
echo "password updated";
}}
else
{
echo "password missmatch";
}
?>
</body>
</html>
No comments:
Post a Comment