Y no aparece mensaje de error es como si no lo leyera, nose que tengo mal.
Código PHP:
if(isset($_POST['save'])){
$privatekey = "6LcXlO8SAAAAACI1R4e4vQYDkrjvY27wfacmMtdj";
$resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
if(isset($_POST['recaptcha_response_field']) && isset($_POST['recaptcha_challenge_field']) && isset($_POST['password']) && isset($_POST['confpass']))
{
if(!$resp->is_valid)
{ $result = "Codigo de seguridad invalido.";
$error = "1"; }
else
{
$pass1 = FilterText($_POST['password']);
//Hashes and salts the old password with the user id (in lowercase) --encryption--
$pass1_hash = HoloHashMD5($pass1, $myrow['name']);
$day1 = FilterText($_POST['day']);
$month1 = FilterText($_POST['month']);
$year1 = FilterText($_POST['year']);
$formatted_dob = "".$day1.".".$month1.".".$year1."";
$newpass = FilterText($_POST['pass']);
//Hashes and salts the new password with the user id (in lowercase) --encryption--
$newpass_hash = HoloHashMD5($newpass, $rawname);
$newpass_conf = FilterText($_POST['confpass']);
if($pass1_hash == $myrow['password']){
if($newpass == $newpass_conf){
if(strlen($newpass) < 6){
$result = "La contraseña debe contener al menos 6 carácteres.";
$error = "1";
} else {
if(strlen($newpass) > 51){
$result = "¡Tu contraseña es demasiado larga! Debe contener 50 carácteres como máximo.";
$error = "1";
} else {
//Updates password --encryption--
mysql_query("UPDATE users SET password = '".$newpass_hash."' WHERE username = '".$rawname."' and password = '".$rawpass."'");
$result = "Contraseña cambiada correctamente. Por favor, entra de nuevo.";
}
}
} else {
$result = "Las contrase&nitlde;as no coinciden.";
$error = "1";
}
} else {
$result = "Los datos no coinciden con los de nuestra base de datos.";
$error = "1";
}
}
}
}
} ?>
<?php } else if($tab == "4"){ ?>
<div class="habblet-container " style="float:left; width: 560px;">
<div class="cbb clearfix settings">
<h2 class="title">Cambia tu contraseña</h2>
<div class="box-content">
<?php
if(!empty($result)){
if($error == "1"){
echo "<div class='rounded rounded-red'>";
} else {
echo "<div class='rounded rounded-green'>";
}
echo "".$result."<br />
</div><br />";
}
?>
Hemos visto que te has conectado con tu <?php echo $shortname; ?> cuenta. Si quieres cambiar la contraseña, deberás introducir tu contraseña para que sepamos que eres el dueño de la cuenta.
<form action="profile/4" method="post" id="passwordform">
<input type="hidden" name="tab" value="4" />
<input type="hidden" name="__app_key" value="HoloCMS" />
<div class="settings-step">
<p>
<label for="currentpassword">Contraseña actual</label><br />
<input type="password" size="32" maxlength="32" name="password" id="currentpassword" class="currentpassword " />
</p>
<div>
</div>
</div>
<div class="settings-step">
<p>
<label for="pass">Nueva Contraseña</label><br />
<input type="password" name="pass" id="password" size="32" maxlength="48" value="" />
</p>
<p>
<label for="confpass">Nueva Contraseña (otra vez)</label><br/>
<input type="password" name="confpass" id="password" size="32" maxlength="48" value="" />
</p>
</div>
</div>
<?php
$publickey = "6LcXlO8SAAAAACoZjwuAIAOCSbPF45KUwRVWNZuT";
echo recaptcha_get_html($publickey, $error); ?>
<p>
<div class="settings-buttons"><center>
<input type="submit" value="Guardar" name="save" class="submit" /></center>
</div>