include('includes/topnav.php')?> | |
if (isset($_POST['test']))
{
$mailid = $_POST['mailid'];
$course = $_POST['course'];
$cpasswd = $_POST['cpasswd'];
$npasswd = $_POST['npasswd'];
require('includes/dbconn.php');
$query="Select cpwd from course_user where vemail='$mailid' and scid=$course";
$result=mysql_query($query);
if (mysql_num_rows($result)<1)
{
echo 'Mailid does not exist';
}
else
{
$row=mysql_fetch_row($result);
if ($row[0]==$cpasswd)
{
$query2="Update course_user set cpwd='$npasswd' where vemail='$mailid' and scid=$course";
$t=mysql_query($query2);
if ($t==1)
{
echo 'Password Changed';
}
else
{
echo 'Unable to change password';
}
}
else
{
echo 'Invalid password';
}
}
}
else
{
?>
Please enter the email address you registered with to obtain your password.
} ?> |