当前位置: 首页>>代码示例>>PHP>>正文


PHP functions::generate_password方法代码示例

本文整理汇总了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']) {
开发者ID:Sywooch,项目名称:dump,代码行数:31,代码来源:additem.php

示例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("Произошла неизвестная ошибка :(");
     }
 }
开发者ID:Sywooch,项目名称:dump,代码行数:12,代码来源:main.php


注:本文中的functions::generate_password方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。