Hmmmmmmm, GRRRRRR!
Oki
I have this
////////////////////////////////////////////////////////////////////////////////////
<?php
$bartitle = "Update Password";
$pagetitle = "Update Password";
$category = "Accounts";
$catitems = "accounts.inc.php";
include("header.inc.php");
if($login == "yes")
{
$process = $POST['process'];
if($process != "1")
{
?>
<form action="updatepass.php" method="post" name="updatepass"><p><font face="Arial" size="3">Here, you may update your account password. Simply fill in the form below with accurate information and click Update Password.</font></p>
<table width="450" border="0" cellspacing="2" cellpadding="2" align="center" bgcolor="cornflowerblue">
<tr>
<td bgcolor="white" width="24%"><font size="3"><font face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular">Old Pass:</font></font></td>
<td bgcolor="white"><input type="password" name="entoldpass" size="54" maxlength="20" border="0"></td>
</tr>
<tr>
<td bgcolor="white" width="24%"><font size="3"><font face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular">Password:</font></font></td>
<td bgcolor="white"><input type="password" name="regnewpass" size="54" maxlength="20" border="0"></td>
</tr>
<tr>
<td bgcolor="white" width="24%"><font size="3"><font face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular">Confirm:</font></font></td>
<td bgcolor="white"><input type="hidden" name="process" value="1"><input type="password" name="confregnewpass" size="54" border="0"></td>
</tr>
</table>
<div align="center">
<p><input type="submit" name="updacct" value="Update Account" border="0"> <input type="reset" border="0"></p>
</div></form>
<?php
} else {
$entoldpass = $POST['entoldpass'];
$regnewpass = $POST['regnewpass'];
$confregnewpass = $POST['confregnewpass'];
if($entoldpass == "")
{
print "<font face=Arial size=3>I'm sorry, you cannot change your password without first entering your current/old one. Please go back and enter it.</font>";
} elseif($entoldpass != $row['password'])
{
print "<font face=Arial size=3>I'm sorry, you did not correctly enter your current/old password. Please go back and try again.</font>";
} elseif($regnewpass == "")
{
print "<font face=Arial size=3>I'm sorry, you cannot change your password to nothing. We don't want anyone else being able to login to your account and ruin it now, do we!?";
} elseif($confregnewpass == "")
{
print "<font face=Arial size=3>Oops, you entered a new password, but forgot to confirm it! Please go back and try again!</font>";
} elseif(strlen($regnewpass) < 4)
{
print "<font face=Arial size=3>Sorry, your password must be four or more charecters for security reasons. Please go back and change it.</font>";
} elseif(strlen($regnewpass) > 20)
{
print "<font face=Arial size=3>I'm sorry, your password can't be more than twenty charecters! Please go back and change it.</font>";
} else {
print "<font face=Arial size=3>You met all my requirements! I will just go and update your password for you!</font>";
$sql = "UPDATE users SET password = '$regnewpass' WHERE username = '$username'";
mysql_query($res);
}
}
} else {
print "<font face=Arial size=3>Sorry, you must be logged in to view this page. To login, simply type your username and password in the provided boxes to the left. Or maybe you haven't <a href=register.php>registered</a> yet.";
}
include("footer.inc.php");
?>
////////////////////////////////////////////////////////////////////////////////////
Now to me that looks fine, how about you? But nope!
Oki
if($login == "yes")
{
then inside that I have a load of if and elseifs...
now that all works unless none of the conditions apply
it doesn't do the else
any ideas why?