本文整理汇总了PHP中functions::generate_password方法的典型用法代码示例。如果您正苦于以下问题:PHP functions::generate_password方法的具体用法?PHP functions::generate_password怎么用?PHP functions::generate_password使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类functions
的用法示例。
在下文中一共展示了functions::generate_password方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isset
/**/
$change = isset($_GET['act']) && $_GET['act'] != 'complete' && $_GET['act'] != 'changed';
/*if($change) {
$b = $db->result("SELECT user_id FROM board WHERE href = '".$_GET['act']."'");
if(!$board->getAdmin() or $board->getUserId() != $b) exit("У Вас нет прав для редкатирования этого объявления!<br />");
}*/
$required = array("title" => "Заголовок", "id_category" => "Категория", "autor" => "Автор", "phone" => "Телефон", "email" => "E-mail", "text" => "Описание", "city" => "Город");
$title = trim($_POST['title']);
$text = trim($_POST['text']);
$price = trim($_POST['price']);
$price_t = trim($_POST['price_t']);
$id_category = trim($_POST['id_category']);
//echo '<pre>';var_dump($_POST);exit();
$info = $_POST;
$user_id = $board->checkUser($info['email']);
$push = array('user_id' => $user_id, 'href' => functions::translit($title) . '-' . functions::generate_password(10), 'status' => 'new');
$info = array_merge($info, $push);
//$info['time'] = !$change ? time() : $db->query("SELECT time FROM board WHERE href = '".functions::q($_GET['act'])."'");
if (!$change) {
$info['time'] = time();
} else {
unset($info['time']);
}
$db->query("SELECT * FROM photo WHERE folder = '" . functions::q($_POST['photos_id']) . "' ORDER BY `time` ASC");
if ($db->getNumRows() > 0) {
$image = new SimpleImage();
$i = 0;
while ($photo = mysql_fetch_array($db->data)) {
$url = 'photo/' . $photo['folder'] . '/' . $photo['name'];
$image->load($url);
if ($i == $_POST['photo_c']) {
示例2: rememberPassword
function rememberPassword($email)
{
$pass = functions::generate_password(8);
$res = $this->db->query("UPDATE users SET pass = '" . md5($pass) . "' WHERE email = '" . functions::q($email) . "'");
if ($res) {
$replace = array("%EMAIL%" => $email, "%PASS%" => $pass);
$this->gomail($email, "remember", $replace);
echo "<div class='success'>Новый пароль отправлен на Ваш e-mail.</div>";
} else {
die("Произошла неизвестная ошибка :(");
}
}