日期:2013-01-02  浏览次数:20713 次

# sendmsg.php
<?php
require "func.php";
if ($b1) {
    if (is_user_exits($fromname) and check_user_password($fromname,$password)) {
        sendmsg();
        echo "成功!<br><form method="POST"><input type="button" value=" 关闭窗口 " name="B1" ></form>";
    }
    else {
        $founderr=1;
        echo "用户名/密码错误!";
    }
}
else {
?>
<html>
<head>
<title>发送留言</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="css/index.css">
</head>

<body bgcolor="#eeeeee">
<form method="post" action="<?php echo $php_self;?>">
  <table width="98%" border="1" cellspacing="0" cellpadding="0" bordercolorlight="#000000" bordercolordark="#FFFFFF">
    <tr align="center">  
      <td colspan="2">给 <a href="userinfo.php?name=<?php echo $name;?>" target="_blank"><?php echo $name;?></a>  
        发送留言</td>
    </tr>
    <tr>  
      <td align="right" width="27%">您的用户名:</td>
      <td width="73%">  
        <input type="text" name="fromname" size="17" maxlength="16" value="<?php echo $jl_forum[name];?>">
        * </td>
    </tr>
    <tr>  
      <td align="right" width="27%">您的密码:</td>
      <td width="73%">  
        <input type="password" name="password" size="17" maxlength="16">
        * </td>
    </tr>
    <tr>  
      <td align="right" width="27%" valign="top">内容:</td>
      <td width="73%">  
        <textarea name="cont" wrap="VIRTUAL" cols="40" rows="3"></textarea>
        <input type="hidden" name="toname" value="<?php echo $name;?>">
        <br>
        <input type="submit" name="b1" value="发送">
        <input type="button" name="Submit" value="取消" >
      </td>
    </tr>
  </table>
</form>
</body>
</html>
<?php
}
?>
###############
# setup.php
# 此为初始化程序,只在上传后第一次执行,之后必须delete,以免出错
#################
<?php
require "func.php";
echo "<h1>初始化数据库</h1><br><br>";
echo "建立数据库连接...ok!<br>";
echo "建立表 boardinfo...";
$sql="CREATE TABLE boardinfo (name varchar(50) NOT NULL, chinesename varchar(50) NOT NULL)";
mysql_query($sql) or die("错误");
echo "ok!<br>";
echo "建立表 user...";
$sql="CREATE TABLE user (id int(11) NOT NULL