login.php

来自「make project on java」· PHP 代码 · 共 29 行

PHP
29
字号
<?php
include"../cache/config.inc.php";
include"begin.php";

if ($_GET["type"] == "post") {
    $username = $_POST["username"];
    if (jyname($_POST['username'])) {
        header("Location: main.php");
        exit;
    } 
	
    $passwordmd5 = md5($_POST['password']);
    $password = substr($passwordmd5, 0, 13) . substr($passwordmd5, -3);

    $result = mysql_query("select * from {$db_prefix}groupuser where username='$username' &&  groupid in('1','2') && password='$password'", $myconn);

    if (mysql_fetch_array($result)) {
        setcookie('adminname', $username, 1800 + time());
        setcookie('adminpw', $password, 1800 + time());

        header("Location: main.php");
        exit;
    } 
} 
require_once './template/header.htm';
require_once './template/login.htm';
require_once './template/footer.htm';

?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?