header('Content-Type: text/html; charset=utf-8');
#error_reporting(E_ALL);
#ini_set('display_errors', '1');
session_start();
include("db.php");
$dt = "nueva contrasena guapas";
$nosignup = 1;
include("metas.php");
include("header2.php");
?>
nueva contrasena
if($_REQUEST["useris"] <> ""){
#echo "requesting password: ";
$stmt = $pdodb->prepare("SELECT ID,username,password,emailis FROM girls WHERE (username=:user OR emailis=:user) LIMIT 1");
$stmt->setFetchMode(PDO::FETCH_ASSOC);
$stmt->execute(array(':user' => trim($_REQUEST["useris"])));
if ($stmt->rowCount() > 0) {
//echo 'found';
while($i2=$stmt->fetch()){
$user_id = $i2["ID"];
$emailis = $i2["emailis"];
$useris = $i2["username"];
}
$resetcode = uniqid();
$stmt2 = $pdodb->prepare("INSERT INTO passreset(mid,resetcode) VALUES(:mid,:resetcode) ON DUPLICATE KEY UPDATE resetcode=:resetcode");
$stmt2->bindParam(':mid',$user_id);
$stmt2->bindParam(':resetcode',$resetcode);
$stmt2->execute();
$subject = 'guapas.org nueva contrasena';
$body = '
usario: '.$useris.'
obtener nueva contrasena: https://www.guapas.org/reset.php?resetcode='.$resetcode.'
perfil
https://www.guapas.org/'.str_replace(" ","-",$username).'
-------------------------------------------------------
';
//echo $email;
mandrill('info@guapas.org',$emailis, $subject, $body);
echo 'usario encontrado.
correo: '.mask_email($emailis).'. mira tu email (tambien en spam)
';
}else{
echo '(usario no encontrado)
';
}
}
?>
include('footer.php');
?>