示例#1
0
<?php 
session_start();
header("content-type:text/html;charset=utf-8");
require_once "MysqlTool.php";
if ($_POST['username'] == "" || $_POST['userpassword'] == "") {
    echo "<script language=\"javascript\">";
    echo "alert(\"对不起,用户名或密码不能为空!\");";
    echo "location.href=\"land.php\"";
    echo "</script>";
} else {
    $username = $_POST['username'];
    $userpad = $_POST['userpassword'];
    $userpassword = md5($userpad);
    $MysqliTool9 = new MysqliTool();
    $sql = "select password from user where name='{$username}' limit 0,1";
    $res = $MysqliTool9->execute_dql($sql);
    if ($row = $res->fetch_assoc()) {
        $password = $row['password'];
        if ($userpassword == $password) {
            $_SESSION['name'] = $username;
            echo "<script language=\"javascript\">";
            echo "location.href=\"vote.php\"";
            echo "</script>";
        } else {
            echo "<script language=\"javascript\">";
            echo "alert(\"对不起,用户名或密码错误!\");";
            echo "location.href=\"land.php\"";
            echo "</script>";
        }
    }
}
示例#2
0
} else {
    $username = $_POST['username'];
    $userpad = $_POST['userpassword'];
    $password = $_POST['password'];
    $sex = $_POST['sex'];
    $useremail = $_POST['useremail'];
    $userpassword = md5($userpad);
    if ($userpad != $password) {
        echo "<script language=\"javascript\">";
        echo "alert(\"对不起,两次输入密码不一致!\");";
        echo "location.href=\"enroll.php\"";
        echo "</script>";
    } else {
        $MysqliTool = new MysqliTool();
        $sql1 = "select * from user where name='{$username}';";
        $res1 = $MysqliTool->execute_dql($sql1);
        if ($row1 = $res1->fetch_row()) {
            echo "<script language=\"javascript\">";
            echo "alert(\"对不起,此用户名已被注册!\");";
            echo "location.href=\"enroll.php\"";
            echo "</script>";
        } else {
            $sql = "insert into user(name,password,sex,email) values('{$username}',md5('{$password}'),'{$sex}','{$useremail}');";
            $res = $MysqliTool->execute_dml($sql);
            if ($res != 1) {
                echo "不成功!!";
            } else {
                echo "<script language=\"javascript\">";
                echo "alert(\"注册成功,点击登录\");";
                echo "location.href=\"land.php\"";
                echo "</script>";
示例#3
0
<?php

if (isset($_POST['submit1'])) {
    $username = $_SESSION['user'];
    $title = $_POST['object'];
    $message = $_POST['message'];
    require_once 'MessageTool.php';
    if ($username != 'NULL' && $title != 'NULL' && $message != 'NULL') {
        $MysqliTool = new MysqliTool();
        $sqlll = "insert into message(user,title,message,add_user,add_message,lastdate) value('{$username}','{$title}','{$message}','null','null',current_timestamp);";
        $res = $MysqliTool->execute_dql($sqlll);
        echo "<script language=\"javascript\">";
        echo "location.href=\"Message_land_back.php\"";
        echo "</script>";
    }
}
if (isset($_POST['submit3'])) {
    if (isset($_POST['ids'])) {
        require_once 'MessageTool.php';
        $MysqliTool = new MysqliTool();
        $ids = $_POST['ids'];
        $sq = "delete from message where id={$ids}";
        $re = $MysqliTool->execute_dml($sq);
        echo "<script language=\"javascript\">";
        echo "location.href=\"Message_land_back.php\"";
        echo "</script>";
    }
}
if (isset($_POST['submit5'])) {
    if (isset($_POST['ids']) && isset($_POST['add_user'])) {
        require_once 'MessageTool.php';
示例#4
0
alter table user add novelist int;
alter table votes drop column novelist;
*/
header("content-type:text/html;charset=utf-8");
require_once "MysqlTool.php";
if (!isset($_POST['novelist'])) {
    echo "<script language=\"javascript\">";
    echo "alert(\"对不起,您还没有选择投票对象!\");";
    echo "location.href=\"vote.php\"";
    echo "</script>";
} else {
    $novelist = $_POST['novelist'];
    $MysqliTooll = new MysqliTool();
    $user = $_SESSION['name'];
    $sql = "select novelist from user where name='{$user}';";
    $res = $MysqliTooll->execute_dql($sql);
    while ($row = $res->fetch_assoc()) {
        if ($row['novelist'] != NULL) {
            echo "<script language=\"javascript\">";
            echo "alert(\"对不起,您之前已经投过票了!\");";
            echo "location.href=\"vote.php\"";
            echo "</script>";
            die;
        }
    }
    $novelist = $_POST['novelist'];
    $sqll = "update user set novelist={$novelist} where name='{$user}';";
    $ress = $MysqliTooll->execute_dml($sqll);
    $sqlll = "select vote from votes where nameid={$novelist}";
    $resss = $MysqliTooll->execute_dql($sqlll);
    while ($row = $resss->fetch_assoc()) {