Hi sridsam,
Do you md5() the password when you enter it into the database on the registration?
instead of doing,
$user = $_SESSION['user1'];
if ('$user')
{
you can directly check it as,
if (isset($_SESSION['user1']))
{
$repeatnewpassword = ($_POST['repeatnewpassword']);
YOu forgot the MD5() function here so,
if ($newpassword==$repeatnewpassword)
{
will always fail. But this is not your issue now.. it fail long before it comes here.
Regards,
Niroshan