Aquí pongo el código para que podáis ayudarme mejor. Un saludo. Muchas gracias.
Por favor estoy deseperada.
![Neurótico](http://static.forosdelweb.com/fdwtheme/images/smilies/scared.png)
CHGPWD.PHP
<?
include_once ("auth.php");
include_once ("authconfig.php");
include_once ("check.php");
include_once ("nivel.php");
?>
<head><title>Cambiar Password</title></head>
<body bgcolor="#FFFFFF">
<p align="center"><b><font size="5" face="Arial">
Cambiar Password</font></b></p>
<div align="center">
<center>
<form method="POST" action="cambiar.php">
<table width="40%" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000">
<tr>
<td width="100%" bgcolor="00781B" colspan="2"> </td>
</tr>
<tr>
<td width="34%" bgcolor="#CCCCCC"><b><font size="2" face="Arial">
Antigua Password:</font></b></td>
<td width="66%" bgcolor="#75b994">
<input type="password" name="oldpasswd" size="25"></td>
</tr>
<tr>
<td width="34%" bgcolor="#CCCCCC"><b><font size="2" face="Arial">
Nueva <br>
Password:</font></b></td>
<td width="66%" bgcolor="#75b994">
<input type="password" name="newpasswd" size="25"></td>
</tr>
<tr>
<td width="34%" height="30" bgcolor="#CCCCCC"><b><font size="2" face="Arial">
Confirmar:</font></b></td>
<td width="66%" bgcolor="#75b994">
<input type="password" name="confirmpasswd" size="25"></td>
</tr>
<tr>
<td width="100%" colspan="2" bgcolor="#CCCCCC"> </td>
</tr>
<tr>
<td width="100%" colspan="2" bgcolor="00781b">
<p align="center"><input type="submit" value="Salvar cambios" name="submit">
<input type="reset" value="Borrar" name="reset"></td>
</td>
</tr>
</table>
</form>
</center>
</div>
</body>
CAMBIAR.PHP
<link href="estilo.css" rel="stylesheet" type="text/css">
<?
include_once ("auth.php");
include_once ("authconfig.php");
include_once ("check.php");
include_once ("nivel.php");
$tabla = mysql_query("SELECT CLAVE FROM PERSONAL WHERE CODIGO= '$codigo'");
$rows = mysql_fetch_array($tabla);
$password = $rows["CLAVE"];
if ($oldpasswd != $password)
{
print "<p align=\"center\">";
print " <font face=\"Arial\" color=\"#FF0000\">";
print " <b>La vieja contraseña es incorrecta!</b>";
print " </font>";
print "</p>";
exit;
}
if (trim($newpasswd) == "")
{
print "<p align=\"center\">";
print " <font face=\"Arial\" color=\"#FF0000\">";
print " <b>El password no puede estar vacio!</b>";
print " </font>";
print "</p>";
exit;
}
if ($newpasswd != $confirmpasswd)
{
print "<p align=\"center\">";
print " <font face=\"Arial\" color=\"#FF0000\">";
print " <b>La nueva contraseña no fue confirmada!</b>";
print " </font>";
print "</p>";
exit;
}
if($oldpasswd == $password || $newpasswd == $confirmpasswd){
$Update = "UPDATE PERSONAL SET CLAVE = '$newpasswd', CLAVE_MD5=MD5('$newpasswd') WHERE CODIGO ='$codigo'";
$result = mysql_query($Update);
echo "<img src=\"Itsmo.gif\" width=\"50\" height=\"25\"></p>";
echo "<a href=\"login.php\">Volver a conectarse</a>";
}
?>