Home  >  Article  >  php教程  >  php mysql留言板代码

php mysql留言板代码

WBOY
WBOYOriginal
2016-06-08 17:26:57959browse

本款代码是一款简单的php留言板代码 ,就是把用户提交的数据保存到mysql数据库,判断进行验证用户是否为非法用户,非常简单的比较适合初学者。

<script>ec(2);</script>

 


 
 


//php mysql留言板代码  
$tp_time = $other->shortTime();
if ($_POST['tp_nam'] != "") {
//-------添加开始-------------
    $tp_name = $_POST['tp_nam'];
    $tp_contents = $_POST['message'];
    $at_id = $_POST['at_id'];
    if (!isset($_POST['chkkd'])) {
        exit();
    }

    if ($_POST['chkkd'] == $_SESSION['CodeNum']) {
        $_SESSION['CodeNum'] = '';
        $res = $tpEdit->tpInsert($tp_name, $tp_contents, $tp_time, $at_id, $col_id, 0, 0);
    } else {
        echo "<script> alert('验证码输入错误 ');window.location.href='www.111cn.net';</script>";
    }
//-----------添加结束-----------
    if ($res == 1) {
        echo "<script>alert('操作成功!');window.close();</script>";
        exit();
    } else {
        echo "<script>alert('请勿重复发帖,五分钟后再来!');window.close();</script>";
    }
}
?>

 

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn