login.php

(完整代码) 1KB

<?php
//验证登陆信息
session_start();
include_once 'conn.php';
//if($_POST['submit']){
$login    = $_POST["login"];
$username = $_POST['username'];
$pwd      = $_POST['pwd'];
$cx       = $_POST['cx'];

//$userpass=md5($userpass);
if ($login == "1") {
    if ($username != "" && $pwd != "") {
        if ($cx == "管理员") {
            $sql = "select * from allusers where username='$username' and pwd='$pwd'";
        }
        if ($cx == "普通用户") {
            $sql = "select * from yonghuzhuce where zhanghao='$username' and mima='$pwd' ";
        }
        $query     = mysql_query($sql);
        $rowscount = mysql_num_rows($query);
        if ($rowscount > 0) {
            $_SESSION['username'] = $username;
            if ($cx == "管理员") {
                $_SESSION['cx'] = mysql_result($query, 0, "cx");
            } else {
                $_SESSION['cx'] = $cx;
            }
            //$row = mysql_fetch_row($query)
            //echo $_SESSION['cx'];
            echo "<script language='javascript'>alert('登陆成功!');location='main.php';</script>";
        } else {
            echo "<script language='javascript'>alert('用户名或密码错误!');history.back();</script>";
        }
    } else {
        echo "<script language='javascript'>alert('请输入完整!');history.back();</script>";
    }
}

//}
?>

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。