Location: PHPKode > projects > l2jweb > get_passwd.php
<?
$errors = array('The security code is invalid!', 'Account dosen\'t exist on this server!');
$err_msg = '';
if (@$_POST['submit'] == 'Remember')
{
    if ($_SESSION['security_code'] != $_POST['sec_code'])
    {
        $err_msg .= $errors[0];
        $smarty->assign('ERR_MSG', $err_msg);
        $content = $smarty->fetch('fogot_passwd.tpl');
    } else
    {
        $temp = md5('reset.passwd' . $_POST['email'] . time());
        $sql = "UPDATE `web_accounts` SET `validation_code`='" . $temp .
            "' WHERE `email`='" . mysql_escape_string($_POST['email']) . "';";
        $forgot_id_sql = $db->query($sql);
        if ($db->affected_rows($forgot_id_sql) > 0)
        {
            $cod = URL . 'index.php?page=activ_new_pass&email=' . $_POST['email'] . '&code=' .
                $temp;
            require_once ('functions/mail.intern.php');
            mail_remember_passwd($_POST['email'], $cod);
            $content = 'All good.';
        } else
        {
            $err_msg .= $errors[1];
            $smarty->assign('ERR_MSG', $err_msg);
            $content = $smarty->fetch('fogot_passwd.tpl');
            //error
        }

    }

} else
    $content = $smarty->fetch('fogot_passwd.tpl');
?>
Return current item: l2jweb