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


PHP user_register函数代码示例

本文整理汇总了PHP中user_register函数的典型用法代码示例。如果您正苦于以下问题:PHP user_register函数的具体用法?PHP user_register怎么用?PHP user_register使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了user_register函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: login_receive

function login_receive()
{
    login_check();
    if (isset($_GET['lostpassword'])) {
        login_password_recovery_receive();
    }
    if (isset($_GET['reg']) && isset($_POST['upsign'])) {
        user_register();
    }
}
开发者ID:carriercomm,项目名称:shell-2,代码行数:10,代码来源:login.php

示例2: registration

function registration($login, $password1, $password2, $email)
{
    //++
    $verification_data_err = verification_reg_data($login, $password1, $password2, $email);
    if ($verification_data_err) {
        $feedback = $verification_data_err;
    } else {
        $password = $password1;
        prepare_reg_data(&$login, &$password, &$email);
        $salt = salting();
        $hash = crypt($password, $salt);
        $feedback = user_register($login, $hash, $salt, $email);
    }
    return $feedback;
}
开发者ID:MOACL,项目名称:moacl.ru,代码行数:15,代码来源:functions.php

示例3: explode

        if (!empty($role)) {
            $role_perms = explode(',', $role['perms']);
        }
        $user_perms = explode(',', $item['perms']);
    }
    if ($_W['isajax'] && $_W['ispost']) {
        $data = array('uniacid' => $_W['uniacid'], 'username' => trim($_GPC['username']), 'realname' => trim($_GPC['realname']), 'mobile' => trim($_GPC['mobile']), 'password' => user_hash($_GPC['password'], random(8)), 'roleid' => intval($_GPC['roleid']), 'status' => intval($_GPC['status']), 'perms' => is_array($_GPC['perms']) ? implode(',', $_GPC['perms']) : '');
        if (!empty($id)) {
            user_update(array('uid' => $data['uid'], 'password' => $_GPC['password']));
            pdo_update('ewei_shop_perm_user', $data, array('id' => $id, 'uniacid' => $_W['uniacid']));
            plog('perm.user.edit', "编辑操作员 ID: {$id} 用户名: {$data['username']} ");
        } else {
            if (user_check(array('username' => $data['username']))) {
                die(json_encode(array('result' => 0, 'message' => '非常抱歉,此用户名已经被注册,你需要更换注册名称!')));
            }
            $data['uid'] = user_register(array('username' => $data['username'], 'password' => $_GPC['password']));
            pdo_insert('ewei_shop_perm_user', $data);
            pdo_insert('uni_account_users', array('uid' => $data['uid'], 'uniacid' => $data['uniacid'], 'role' => 'operator'));
            $id = pdo_insertid();
            plog('perm.user.add', "添加操作员 ID: {$id} 用户名: {$data['username']} ");
        }
        die(json_encode(array('result' => 1)));
    }
} elseif ($operation == 'delete') {
    ca('perm.user.delete');
    $id = intval($_GPC['id']);
    $item = pdo_fetch("SELECT id,uid,username FROM " . tablename('ewei_shop_perm_user') . " WHERE id = '{$id}'");
    if (empty($item)) {
        message('抱歉,操作员不存在或是已经被删除!', $this->createPluginWebUrl('perm/user', array('op' => 'display')), 'error');
    }
    pdo_delete('users', array('uid' => $item['uid']));
开发者ID:noikiy,项目名称:mygit,代码行数:31,代码来源:user.php

示例4: user_register

        $error = '<div style="margin-top:-10px;margin-left:10px;">Your password needs to be <br>atleast 5 characters</div>';
        include 'index.php';
        exit;
    }
    // Check if the passwords match
    if ($_POST['email'] != $_POST['confirmemail']) {
        // Reshow the form with an error
        $error = 'Your emails do not match';
        include 'index.php';
        exit;
    }
    $username = $_POST['username'];
    if (mysql_num_rows(mysql_query("SELECT username FROM user WHERE username = '{$username}'"))) {
        $error = 'The username already exists';
        include 'index.php';
        exit;
    }
    if (mysql_num_rows(mysql_query("SELECT username FROM user WHERE email = '{$email}'"))) {
        $error = 'The email already exists';
        include 'index.php';
        exit;
    }
    if (mysql_num_rows(mysql_query("SELECT username FROM user WHERE youtubeUserName = '{$youtubeUserName}'"))) {
        $error = 'The youtube name already exists';
        include 'index.php';
        exit;
    }
    // Everything is ok, register
    user_register($_POST['username'], $_POST['password'], $_POST['email'], $_POST['youtubeUserName']);
    header('Location: index.php?f=sf');
}
开发者ID:danielheyman,项目名称:EazySubs,代码行数:31,代码来源:registerBody.php

示例5: sprintf

            $subject = $lang_module['account_register'];
            $message = sprintf($lang_module['account_register_info'], $array_register['first_name'], $global_config['site_name'], NV_MY_DOMAIN . nv_url_rewrite(NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name, true), $array_register['username']);
            nv_sendmail($global_config['site_email'], $array_register['email'], $subject, $message);
            if (!empty($global_config['auto_login_after_reg'])) {
                // Auto login
                $array_user = array('userid' => $userid, 'last_agent' => '', 'last_ip' => '', 'last_login' => 0, 'last_openid' => '');
                validUserLog($array_user, 1, '');
                $nv_redirect = nv_redirect_decrypt($nv_redirect);
                $url = !empty($nv_redirect) ? $nv_redirect : NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name;
            } else {
                $url = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=login';
                if (!empty($nv_redirect)) {
                    $url .= '&nv_redirect=' . $nv_redirect;
                }
            }
            $nv_redirect = '';
            die(reg_result(array('status' => 'ok', 'input' => nv_url_rewrite($url, true), 'mess' => $lang_module['register_ok'])));
        }
    }
}
if ($nv_Request->isset_request('get_usage_terms', 'post')) {
    $sql = "SELECT content FROM " . NV_USERS_GLOBALTABLE . "_config WHERE config='siteterms_" . NV_LANG_DATA . "'";
    $siteterms = $db->query($sql)->fetchColumn();
    include NV_ROOTDIR . '/includes/header.php';
    echo $siteterms;
    include NV_ROOTDIR . '/includes/footer.php';
}
$contents = user_register($gfx_chk, $array_register['checkss'], $data_questions, $array_field_config, $custom_fields);
include NV_ROOTDIR . '/includes/header.php';
echo nv_site_theme($contents);
include NV_ROOTDIR . '/includes/footer.php';
开发者ID:NukeVietCMS,项目名称:CodeWeb,代码行数:31,代码来源:register.php

示例6: mysqli_connect

*/
//error_reporting(E_ALL);
//ini_set('display_errors', 'On');
$rootdir = "/";
include $_SERVER['DOCUMENT_ROOT'] . $rootdir . "/php/base.php";
$connection = mysqli_connect($dbhost, $dbuser, $dbpass, $dblogin) or die("ERROR: Can't connect to MySQL DB: " . mysql_error());
if (isset($_GET["action"])) {
    switch ($_GET["action"]) {
        case "check":
            user_check();
            break;
        case "login":
            user_login();
            break;
        case "register":
            user_register();
            break;
        case "remind":
            user_remind();
            break;
        case "update":
            user_update();
            break;
        case "logout":
            user_logout();
            break;
    }
}
function user_check()
{
    if ($_SESSION['LoggedIn'] == 1) {
开发者ID:katjaq,项目名称:braincatalogue,代码行数:31,代码来源:login.php

示例7: user_login_openid_agree

 case 'login_openid2':
     user_login_openid_agree(isset($_POST['agree']));
     log_timing();
     header('Location:index.php');
     exit;
 case 'logout':
     user_logout();
     if (isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], 'login.php') === false) {
         header('Location:' . $_SERVER['HTTP_REFERER']);
     } else {
         header('Location:index.php');
     }
     log_timing();
     exit;
 case 'reg_done':
     $reg_status = user_register($_POST);
     if ($reg_status == 1) {
         header("Location:index.php");
         exit;
     } else {
         $smarty->assign('reg_status', $reg_status);
     }
     break;
 case 'change_pw':
     $smarty->assign('change_status', user_change_password($_POST));
     break;
 case 'change_email':
     $smarty->assign('change_status', user_change_email($_POST));
     break;
 case 'generate_passwd':
     $smarty->assign('gen_status', user_generate_password($_POST['email']));
开发者ID:ayunah,项目名称:opencorpora,代码行数:31,代码来源:login.php

示例8: activate_user

function activate_user($usname, $pwd, $email, $member_type, $mobile)
{
    global $timestamp, $online_ip;
    if (defined('UC_API')) {
        include_once QISHI_ROOT_PATH . 'uc_client/client.php';
        list($activateuid, $username, $password, $email) = uc_user_login($usname, $pwd);
        if ($activateuid > 0) {
            return user_register(4, $pwd, $member_type, $email, $mobile, false, $usname);
        } else {
            return -10;
        }
    }
    return false;
}
开发者ID:winiceo,项目名称:job,代码行数:14,代码来源:fun_user.php

示例9: trim

     if (in_array("email", $reg_com_config) && $reg_type == 1) {
         $com_setarr['email'] = $_POST['reg_email'] ? trim($_POST['reg_email']) : showmsg("请输入企业联系邮箱");
     }
     if (in_array("address", $reg_com_config)) {
         $com_setarr['address'] = $_POST['address'] ? trim($_POST['address']) : showmsg("请输入企业详细地址");
     }
     if (in_array("contents", $reg_com_config)) {
         $com_setarr['contents'] = $_POST['contents'] ? trim($_POST['contents']) : showmsg("请输入企业介绍");
     }
 }
 if ($reg_type == 1) {
     $mobile = $_POST['mobile'] ? trim($_POST['mobile']) : showmsg("注册手机号丢失");
     $rst = user_register($reg_type, $password, $member_type, "", $mobile, false);
 } else {
     $email = $_POST['email'] ? trim($_POST['email']) : showmsg("注册邮箱号丢失");
     $rst = user_register($reg_type, $password, $member_type, $email, "", $uc_reg = true);
 }
 if ($rst > 0) {
     $user = get_user_inid($rst);
     // 企业信息
     if ($member_type == 1 && !empty($com_setarr)) {
         $com_setarr['uid'] = intval($rst);
         $com_setarr['audit'] = intval($_CFG['audit_add_com']);
         $com_setarr['addtime'] = $timestamp;
         $com_setarr['refreshtime'] = $timestamp;
         $db->inserttable(table('company_profile'), $com_setarr);
     }
     $login_js = user_login($user['username'], $password);
     $mailconfig = get_cache('mailconfig');
     if ($mailconfig['set_reg'] == "1") {
         switch ($user['utype']) {
开发者ID:winiceo,项目名称:job,代码行数:31,代码来源:user_reg.php

示例10: elseif

    } elseif ($password != $_POST['password1']) {
        $err = "两次输入的密码不同";
    } elseif (empty($email) || !ereg("^[-a-zA-Z0-9_\\.]+\\@([0-9A-Za-z][0-9A-Za-z-]+\\.)+[A-Za-z]{2,5}\$", $email)) {
        $err = "电子邮箱格式错误";
    }
    if (get_user_inusername($username)) {
        $err = "用户名已经存在";
    }
    if (get_user_inemail($email)) {
        $err = "电子邮箱已经存在";
    }
    if ($err) {
        $smarty->assign('err', $err);
        $smarty->assign('type', $member_type);
        $smarty->display("wap/reg_form.html");
        exit;
    }
    $register = user_register(3, $password, $member_type, $email, $mobile = "", true, $username, "");
    if ($register > 0) {
        $login_js = wap_user_login($username, $password);
        $mailconfig = get_cache('mailconfig');
        if ($mailconfig['set_reg'] == "1") {
            dfopen($_CFG['site_domain'] . $_CFG['site_dir'] . "plus/asyn_mail.php?uid=" . $_SESSION['uid'] . "&key=" . asyn_userkey($_SESSION['uid']) . "&sendemail=" . $email . "&sendusername=" . $username . "&sendpassword=" . $password . "&act=reg");
        }
        if ($login_js) {
            header("location:" . $login_js['qs_login']);
        }
    } else {
        header("location:wap_user_reg.php");
    }
}
开发者ID:source-hunter,项目名称:74cms,代码行数:31,代码来源:wap_user_reg.php

示例11: mysql_real_escape_string

# For details see the file LICENSE.html in the top level of the source.
require_once "../database.inc";
require_once "user.inc";
$user_name = mysql_real_escape_string($_POST["user_name"]);
$password1 = mysql_real_escape_string($_POST["password1"]);
$password2 = mysql_real_escape_string($_POST["password2"]);
$email = mysql_real_escape_string($_POST["email"]);
$real_name = mysql_real_escape_string($_POST["real_name"]);
$submit = mysql_real_escape_string($_POST["submit"]);
if (user_isloggedin()) {
    user_logout();
    $user_name = '';
}
$ok = false;
if ($submit) {
    $ok = user_register($user_name, $password1, $password2, $email, $real_name);
}
$title = "Sign up for Newsletter, Forum and Policies";
$onload = "givefocus('real_name')";
pw_header();
if ($feedback) {
    if ($ok) {
        echo "<p>{$feedback}</p>";
    } else {
        echo "<div class=\"error\"><h2>Registration not complete,\n        please try again</h2><p>{$feedback}</div>";
    }
} else {
    print "<p>\n    Quickly fill in the information below, and we'll send you\n    a confirmation email.  You will then receive the Public\n    Whip newsletter, which will be at most once a month.\n    Occasionally we will send an extra small topical newsletter.\n    You will also be able to edit division descriptions and policies.  After\n    signing up you can unsubscribe from the newsletter, but still\n    edit divisions and policies.";
    print "<p><a href=\"../newsletters/archive.php\">Read archive of previous newsletters</a>";
    print "<br><a href=\"settings.php\">Log in to change settings if you already signed up</a>";
}
开发者ID:damncabbage,项目名称:publicwhip,代码行数:31,代码来源:register.php

示例12: user_register

<?php

require 'js/parse/autoload.php';
require_once "config.php";
require_once "common.php";
use Parse\ParseException;
use Parse\ParseUser;
use Parse\ParseSessionStorage;
use Parse\ParseClient;
use Parse\ParseQuery;
use Parse\ParseObject;
$func = $_POST['check'];
if ($func == 'register') {
    echo user_register($_POST['username'], $_POST['first'], $_POST['last'], $_POST['password'], $_POST['email'], $_POST['location'], $_POST['lat'], $_POST['lng']);
    mail_box($_POST['email'], 'Register', 'Thank  you for registering', 'register');
}
if ($func == 'guest') {
    (string) ($uniq = uniqid());
    $name = "Guest-" . $uniq;
    $user = new ParseUser();
    $user->set("username", $name);
    $user->set("password", $uniq);
    $user->setArray("connected", []);
    $user->set("status", 0);
    $user->set("avatar", "img/profile_default_male.jpg");
    $response = new Response();
    try {
        $user->signUp();
        //user_register_create_chat($user);
        $_SESSION['user'] = $user;
        $_SESSION['notification'] = true;
开发者ID:louk,项目名称:One-Nice-Thing,代码行数:31,代码来源:user.php

示例13: header

                } else {
                    if (strlen($userpass) < 8) {
                        $errors[] = "votre mot de passe doit comporter au minimum 8 caractères";
                    } else {
                        $sql = 'SELECT user_name , user_email FROM users where user_name=:user OR user_email=:email';
                        try {
                            $stmt = $db_connexion->prepare($sql);
                            $stmt->execute(array(':user' => $username, ':email' => $usermail));
                            $row = $stmt->fetch();
                            if ($row["user_name"] == $username) {
                                $errors[] = "le pseudo a déjà été pris";
                            } else {
                                if ($row["user_email"] == $usermail) {
                                    $errors[] = "L'email a déjà été renseigné";
                                } else {
                                    if (user_register($username, $usermail, $userpass, $db_connexion)) {
                                        header("Location:inscription.php?succes");
                                    }
                                }
                            }
                        } catch (PDOException $e) {
                            echo $e->getMessage();
                        }
                    }
                }
            }
        }
    }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//
开发者ID:amine142,项目名称:userprofil,代码行数:31,代码来源:inscription.php

示例14: elseif

    }
} elseif ($act == 'phone_reg') {
    $_POST = array_map("utf8_to_gbk", $_POST);
    require_once QISHI_ROOT_PATH . 'include/fun_wap.php';
    require_once QISHI_ROOT_PATH . 'include/fun_user.php';
    $mobile = trim($_POST['mobile']);
    $password_mobile = isset($_POST['password_mobile']) ? trim($_POST['password_mobile']) : "";
    $member_type = intval($_POST['utype']);
    $agreement_mobile = isset($_POST['agreement_mobile']) ? intval($_POST['agreement_mobile']) : "";
    if (empty($mobile) || empty($password_mobile) || empty($member_type)) {
        exit("信息不完整!");
    } elseif (empty($agreement_mobile)) {
        exit("需要同意注册协议");
    }
    //验证验证码是否正确
    $verifycode = trim($_POST['verifycode']);
    if (empty($verifycode) || empty($_SESSION['mobile_rand']) || $verifycode != $_SESSION['mobile_rand']) {
        exit("验证码错误!");
    }
    //手机号注册
    $register = user_register(1, $password_mobile, $member_type, $email = "", $mobile, false, $username = "", "");
    if ($register > 0) {
        $user_info = get_user_inmobile($mobile);
        $login_js = wap_user_login($user_info['username'], $password_mobile);
        if ($login_js) {
            exit($login_js['qs_login']);
        }
    } else {
        exit("user_reg.php");
    }
}
开发者ID:winiceo,项目名称:job,代码行数:31,代码来源:user_reg.php

示例15: defined

/**
 * [Weizan System] Copyright (c) 2014 012WZ.COM
 * Weizan is NOT a free software, it under the license terms, visited http://www.qdaygroup.com/ for more details.
 */
defined('IN_IA') or exit('Access Denied');
$_W['page']['title'] = '添加用户 - 用户管理 - 用户管理';
if (checksubmit()) {
    load()->model('user');
    $user = array();
    $user['username'] = trim($_GPC['username']);
    if (!preg_match(REGULAR_USERNAME, $user['username'])) {
        message('必须输入用户名,格式为 3-15 位字符,可以包括汉字、字母(不区分大小写)、数字、下划线和句点。');
    }
    if (user_check(array('username' => $user['username']))) {
        message('非常抱歉,此用户名已经被注册,你需要更换注册名称!');
    }
    $user['password'] = $_GPC['password'];
    if (istrlen($user['password']) < 8) {
        message('必须输入密码,且密码长度不得低于8位。');
    }
    $user['remark'] = $_GPC['remark'];
    $user['groupid'] = intval($_GPC['groupid']) ? intval($_GPC['groupid']) : message('请选择所属用户组');
    $uid = user_register($user);
    if ($uid > 0) {
        unset($user['password']);
        message('用户增加成功!', url('user/edit', array('uid' => $uid)));
    }
    message('增加用户失败,请稍候重试或联系网站管理员解决!');
}
$groups = pdo_fetchall("SELECT id, name FROM " . tablename('users_group') . " ORDER BY id ASC");
template('user/create');
开发者ID:6662680,项目名称:qday_wx,代码行数:31,代码来源:create.ctrl.php


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