當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UserData::add方法代碼示例

本文整理匯總了PHP中UserData::add方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserData::add方法的具體用法?PHP UserData::add怎麽用?PHP UserData::add使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UserData的用法示例。


在下文中一共展示了UserData::add方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: UserData

<?php

$p = new UserData();
$p->name = $_POST['name'];
$p->email = $_POST['email'];
$p->password = sha1(md5($_POST['password']));
$p->usertype_id = 1;
$p->add();
print "<script>window.location='index.php?view=login';</script>";
開發者ID:evilnapsis,項目名稱:imayik,代碼行數:9,代碼來源:action-default.php

示例2: strlen

if (!empty($_POST)) {
    if ($_POST["name"] != "" && $_POST["lastname"] != "" && $_POST["email"] != "" && $_POST["password"] != "") {
        $user = UserData::getByEmail($_POST["email"]);
        if ($user == null) {
            $str = "abcdefghijklmopqrstuvwxyz1234567890";
            $code = "";
            for ($i = 0; $i < 6; $i++) {
                $code .= $str[rand(0, strlen($str) - 1)];
            }
            $user = new UserData();
            $user->name = $_POST["name"];
            $user->lastname = $_POST["lastname"];
            $user->email = $_POST["email"];
            $user->password = sha1(md5($_POST["password"]));
            $user->code = $code;
            $u = $user->add();
            $p = new ProfileData();
            $p->user_id = $u[1];
            $p->add();
            $msg = "<body><h1>Registro Exitoso</h1>\r\n\t\t\t\t\t<p>Ahora debes activar tu cuenta en el siguiente link:</p>\r\n\t\t\t\t\t<p><a href='http://youhost/app/index.php?r=index/processactivation&e=" . sha1(md5($_POST["email"])) . "&c=" . sha1(md5($code)) . "'>Activa tu cuenta:</a></p>\r\n\t\t\t\t\t<p>O tambien puedes usar el siguiente codigo de activacion: " . $code . "</p>\r\n\t\t\t\t\t</body>";
            mail($_POST["email"], "Registro Exitoso", $msg);
            /* $f = fopen (ROOT."/register.txt","w");
            			fwrite($f, $msg);
            			fclose($f);
            			*/
            Core::alert("Registro Exitoso!, se ha enviado un correo electronico con los datos necesarios para activar su cuenta.");
            Core::redir("./");
        } else {
            Core::alert("El email proporcionado ya esta registrado.");
            Core::redir("./");
        }
開發者ID:evilnapsis,項目名稱:smile,代碼行數:31,代碼來源:action-default.php

示例3: UserData

<?php

if (!empty($_POST)) {
    $user = new UserData();
    $user->name = $_POST["name"];
    $user->lastname = $_POST["lastname"];
    $user->username = $_POST["username"];
    $user->password = sha1(md5($_POST["password"]));
    $user->add();
    Core::alert("Registro Exitoso!, ya puedes a iniciar sesion con tu nombre de usuario y password.");
    Core::redir("./");
}
開發者ID:evilnapsis,項目名稱:xoolar-lite,代碼行數:12,代碼來源:action-default.php

示例4: sregAction

 /**
  * 小店注冊
  */
 public function sregAction()
 {
     //注冊時必填郵箱和手機
     if (ComTool::isAjax()) {
         if (isset($_POST['captcha'])) {
             $captcha = trim($this->post('captcha'));
             if (!ComTool::checkCaptcha($captcha)) {
                 ComTool::ajax(100001, '驗證碼錯誤');
             }
         }
         $email = trim($this->post('email'));
         ComTool::checkEmpty($email, '請填寫常用郵箱');
         ComTool::checkMaxLen($email, 32, '郵箱最多32位');
         if (!ComTool::isEmail($email)) {
             ComTool::ajax(100001, '請填寫正確的郵箱');
         }
         //檢查郵箱唯一性
         $user = UserData::getByEmail($email);
         if ($user) {
             ComTool::ajax(100001, '郵箱已被注冊');
         }
         $mobile = '';
         $mobile = trim($this->post('mobile'));
         ComTool::checkEmpty($mobile, '請填寫常用手機號');
         if (!ComTool::isMobile($mobile)) {
             ComTool::ajax(100001, '請填寫正確的手機號');
         }
         //檢查手機唯一性
         $user = UserData::getByMobile($mobile);
         if ($user) {
             ComTool::ajax(100001, '手機號已被注冊');
         }
         $city = trim($this->post('city'));
         ComTool::checkEmpty($city, '請選擇城市');
         $area = trim($this->post('area'));
         ComTool::checkEmpty($area, '請選擇區域');
         $group = trim($this->post('group'));
         ComTool::checkEmpty($group, '請選擇圈子');
         $addr_desc = trim($this->post('addr_desc'));
         ComTool::checkEmpty($addr_desc, '請填寫詳細位置');
         ComTool::checkMaxLen($addr_desc, 32, '詳細位置最多32位');
         $passwd = trim($this->post('passwd'));
         ComTool::checkEmpty($passwd, '請輸入密碼');
         ComTool::checkMinMaxLen($passwd, 6, 16, '密碼6-16位');
         $cpasswd = trim($this->post('cpasswd'));
         ComTool::checkEqual($passwd, $cpasswd, '兩次輸入的密碼不同');
         $res = UserData::add(array('email' => $email, 'mobile' => $mobile, 'passwd' => md5($passwd), 'create_time' => time(), 'update_time' => time(), 'status' => 1));
         /* if ($res === false) {
             ComTool::ajax ( 100001, '服務器忙,請重試' );
            }
            $res = UserGroupData::add ( array (
                    'user_id' => $res,
                    'group_id' => $group,
                    'detail' => $addr_desc,
                    'status' => 1
            ) ); */
         ComTool::result($res, '服務器忙,請重試', '注冊成功,即將跳轉');
     }
     $this->display();
 }
開發者ID:jianchengdu,項目名稱:dangjia,代碼行數:63,代碼來源:AccController.php


注:本文中的UserData::add方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。