• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP user_id_from_username函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: login

function login($username, $password)
{
    $user_id = user_id_from_username($username);
    $username = sanitize($username);
    $password = hash('sha512', $password);
    return mysql_result(mysql_query("SELECT COUNT(`user_id`) FROM `bplay_users` WHERE `username`='{$username}' AND `password`='{$password}'"), 0) == 1 ? $user_id : false;
}
开发者ID:SDCore,项目名称:blue-play,代码行数:7,代码来源:users.php


示例2: login

function login($username, $password)
{
    $user_id = user_id_from_username($username);
    $username = sanitize($username);
    $password = md5($password);
    return mysql_result(mysql_query("SELECT COUNT(user_id) FROM users WHERE username = '{$username}' AND password = '{$password}'"), 0) == 1 ? $user_id : false;
}
开发者ID:rushoratiu,项目名称:horatiusirut,代码行数:7,代码来源:users.php


示例3: login

function login($username, $password)
{
    $user_id = user_id_from_username($username);
    $username = sanitize($username);
    $password = md5($password);
    return mysql_result(mysql_query("SELECT COUNT(`user_id`) FROM `login_admin` WHERE `username` = '{$username}' AND `password` = '{$password}'"), 0) == 1 ? $user_id : false;
}
开发者ID:briannci,项目名称:CollegeWork,代码行数:7,代码来源:users.php


示例4: login

function login($username, $password)
{
    $user_id = user_id_from_username($username);
    $username = sanitize($username);
    $password = md5($password);
    return mysql_result(mysql_query("SELECT COUNT(`UID`) FROM `users` WHERE `Email`='{$username}' AND `Password`='{$password}'"), 0) ? $user_id : false;
}
开发者ID:raull240,项目名称:mini-Craigslist,代码行数:7,代码来源:users.php


示例5: login

function login($name, $password)
{
    $user_id = user_id_from_username($name);
    $name = sanitize($name);
    //$password = md5($password);
    $query = mysql_query("SELECT COUNT(`ID`) FROM `humans` WHERE `name` = '{$name}' AND `password` = '{$password}'");
    return mysql_result($query, 0) == 1 ? $user_id : false;
}
开发者ID:brianmerry,项目名称:indiBeenFed,代码行数:8,代码来源:users.php


示例6: login

function login($username, $password)
{
    $user_id = user_id_from_username($username);
    $username = sanitize($username);
    $pass = sanitize($password);
    $query = mysql_query("SELECT COUNT(`user_id`) FROM `tbl_user` WHERE `username` = '{$username}' AND `password` = '{$pass}'");
    return mysql_result($query, 0) == 1 ? $user_id : false;
}
开发者ID:zander009,项目名称:My-first-project-in-Github,代码行数:8,代码来源:users.php


示例7: login

function login($username, $password)
{
    require 'core/database/connect.php';
    //file that connects to database
    $user_id = user_id_from_username($username);
    $username = sanitize($username);
    //    $password = md5($password); ideally we want to encrypt the password when the user registers
    return mysqli_result(mysqli_query($connect, "SELECT COUNT(`ID`) FROM `users` WHERE `UserName` = '{$username}' AND `Password` = '{$password}'"), 0) == 1 ? $user_id : false;
}
开发者ID:abelhect,项目名称:merkdoenvio,代码行数:9,代码来源:user.php


示例8: login

function login($username, $password, $conn)
{
    $user_id = user_id_from_username($username, $conn);
    $password = md5($password);
    $query = $conn->prepare("SELECT COUNT(user_id) FROM users WHERE username = :username AND password = :password");
    $query->execute(array(':username' => $username, ':password' => $password));
    if ($query->fetchColumn() > 0) {
        return $user_id;
    } else {
        return false;
    }
}
开发者ID:emilsrits,项目名称:RB,代码行数:12,代码来源:general.php


示例9: login

function login($username, $password)
{
    global $link;
    $user_id = user_id_from_username($username);
    $username = sanitize($username);
    $password = sha1($password);
    $query = mysqli_query($link, "SELECT azs_employee_id FROM employee WHERE username = '{$username}' AND password = '{$password}'");
    if (mysqli_num_rows($query) > 0) {
        echo "Login Successful";
        return $user_id;
    } else {
        return false;
    }
}
开发者ID:Wakuza,项目名称:azs,代码行数:14,代码来源:users.php


示例10: login

function login($username, $password)
{
    global $db;
    $user_id = user_id_from_username($username);
    $username = sanitize($username);
    $query3 = "SELECT * FROM `users` WHERE `username` = '{$username}'";
    $result = $db->query($query3);
    if ($result->num_rows > 0) {
        $user = $result->fetch_assoc();
        if (password_verify($password, $user['password'])) {
            $_SESSION['user'] = $user;
            return true;
        }
        return false;
    } else {
        return false;
    }
    $db->close();
}
开发者ID:AleksandarGjorgievski,项目名称:biblioteka,代码行数:19,代码来源:users.php


示例11: protect_page

<?php

include 'core/init.php';
include 'includes/overall/overall_header.php';
protect_page();
if (!empty($_GET['username'])) {
    $username = $_GET['username'];
    if (user_exists($username)) {
        $user_id = user_id_from_username($username);
        $profile_data = get_user_data($user_id, 'first_name', 'last_name', 'email', 'profile');
        //echo '<img src="', $user_data['profile'], '" alt="', $user_data['first_name'], '\'s Profile Image">';
        ?>
		<h1><?php 
        echo $profile_data['first_name'];
        ?>
's Profile</h1>
		<br>
		<p>Howdy!  What would you like to do?</p>
	<?php 
    } else {
        ?>
		<p>Sorry, that user does not exist.</p>
	<?php 
    }
} else {
    header('Location: index.php');
    exit;
}
include 'includes/overall/overall_footer.php';
开发者ID:skinnerdev,项目名称:ballin-batman,代码行数:29,代码来源:profile.php


示例12: login

function login($username, $password)
{
    global $db;
    $user_id = user_id_from_username($username);
    $password = md5($password);
    $query = $db->prepare("SELECT COUNT(`user_id`) as `count`\n\t\t\t\t\t\tFROM `users` \n\t\t\t\t\t\tWHERE `username`= :username AND `password`= :password");
    $query->bindParam(':username', $username);
    $query->bindParam(':password', $password);
    $query->execute();
    $result = $query->fetch(PDO::FETCH_ASSOC);
    $count = $result['count'];
    return $count == 1 ? $user_id : false;
}
开发者ID:stevensmetellus,项目名称:medium-clone,代码行数:13,代码来源:users.php


示例13: login

function login($username, $password)
{
    $user_id = user_id_from_username($username);
    $username = sanitize($username);
    $password = md5($password);
    $sql = "SELECT user_id FROM users WHERE username='{$username}' AND password='{$password}'";
    $result = mysql_query($sql);
    $row = mysql_fetch_assoc($result);
    return $row ? $user_id : false;
}
开发者ID:NucleusStudios,项目名称:php_login_register,代码行数:10,代码来源:users.php


示例14: login

function login($username, $password)
{
    $user_id = user_id_from_username($username);
    $password = md5($password);
    return mysql_result(mysql_query("SELECT COUNT 'id' FROM 'users' WHERE 'email' = '{$username}' AND 'password' = '{$password}'"), 0) == 1 ? $user_id : false;
}
开发者ID:Uc4O,项目名称:stirl,代码行数:6,代码来源:loginUsers.php


示例15: protect_page

<?php

include_once '../core/init.php';
protect_page();
$username = trim($_POST['name_user']);
$name_data = trim($_POST['name_data']);
$bio_data = trim($_POST['bio_data']);
if ($session_user_id == user_id_from_username($username)) {
    $words = explode(" ", $name_data);
    $fname = $words[0];
    $lname = $words[1];
    try {
        global $db;
        $query = $db->prepare("UPDATE `users` \r\n\t\t\t\t\t\t\tSET `first_name` = :fname, `last_name` = :lname, `bio` = :bio_data \r\n\t\t\t\t\t\t\tWHERE `username` = :username");
        $query->bindValue(':fname', $fname);
        $query->bindValue(':lname', $lname);
        $query->bindValue(':bio_data', $bio_data);
        $query->bindValue(':username', $username);
        $query->execute();
    } catch (customException $e) {
        error_log($e->errorMessage());
    }
}
开发者ID:stevensmetellus,项目名称:medium-clone,代码行数:23,代码来源:profile_s.php


示例16: login

 $password = $_POST['password'];
 //$captcha = $_POST['captcha'];
 if (user_exists($username) === false) {
     $errors[] = 'Account doesn\'t exist.';
 } else {
     if (user_active($username) === false) {
         $errors[] = 'Account is disabled.';
     } else {
         $login = login($username, $password);
         if ($login === false) {
             $errors[] = 'Username or password is incorrect!';
         } else {
             $role = user_role($username);
             //set the user session
             $_SESSION['Id'] = $login;
             $_SESSION['key_user'] = user_id_from_username($username);
             //$connect = mysql_connect("locahost","root","secret");
             //mysql_select_db("iicssched");
             $connect = mysql_connect("locahost", "root", "");
             mysql_select_db("iicssched");
             /*
             mysql_query("DELETE FROM loginattempt WHERE loginattempt>0");
             mysql_query("ALTER TABLE loginattempt AUTO_INCREMENT = 1");
             */
             //redirect user to home
             switch ($role) {
                 case 1:
                     header('Location: sup/welcome.php');
                     //for super admin
                     break;
                 case 2:
开发者ID:kentmarionvg,项目名称:iicss,代码行数:31,代码来源:redirect.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP user_info函数代码示例发布时间:2022-05-23
下一篇:
PHP user_id函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap