PHP留言板(范例)

WBOY
Release: 2016-06-13 12:36:27
Original
1046 people have browsed it

PHP留言板(实例)

lyb.htm




 

    姓名:
   
     *
    

    我是:
     校长
     主任
     教师
     家长
     学生
    

    QQ:
     不公开,建议填写以便及时回复通知到你
    

    E-mail:
     *
    

    手机号码:
     *
    

    我要留言:
    
    

   

    
    
   

   

    

    



lyb.php

    @$name=$_POST["name"];
    @$lb=$_POST["lb"];
    @$qq=$_POST["qq"];
    @$email=$_POST["email"];
    @$phone=$_POST["phone"];
    @$content=$_POST["content"];
    $conn=mysql_connect("localhost","root","123");
    if($content!="")
    {
        $conn=mysql_connect("localhost","root","123");
        mysql_select_db("lyb");
    //    mysql_query("set names gbk");
        $sql="insert into ly(name,lb,qq,email,phone,content) values('{$name}','{$lb}','{$qq}','{$email}','{$phone}','{$content}')";
        //var_dump($sql);
        //die();
        $rs=mysql_query($sql);
        $row=mysql_affected_rows($conn);
        if ($row>0)
        {
            echo "";
        }
        else
        {
            echo "";
        }
    }
?> 

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!