选择显示字体大小

基于mysql的论坛(7)

# sendmsg.php
<?php
require "func.php";
if (&#36;b1) {
    if (is_user_exits(&#36;fromname) and check_user_password(&#36;fromname,&#36;password)) {
        sendmsg();
        echo "成功!<br><form method="post"><input type="button" value=" 关闭窗口 " name="b1" onclick="window.close()"></form>";
    }
    else {
        &#36;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 &#36;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 &#36;name;?>" target="_blank"><?php echo &#36;name;?></a>  
        发送留言</td>
    </tr>
    <tr>  
      <td align="right" width="'">您的用户名:</td>
      <td width="73%">  
        <input type="text" name="fromname" size="17" maxlength="16" value="<?php echo &#36;jl_forum[name];?>">
        * </td>
    </tr>
    <tr>  
      <td align="right" width="'">您的密码:</td>
      <td width="73%">  
        <input type="password" name="password" size="17" maxlength="16">
        * </td>
    </tr>
    <tr>  
      <td align="right" width="'" valign="top">内容:</td>
      <td width="73%">  
        <textarea name="cont" wrap="virtual" cols="40" rows="3"></textarea>
        <input type="hidden" name="toname" value="<?php echo &#36;name;?>">
        <br>
        <input type="submit" name="b1" value="发送">
        <input type="button" name="submit" value="取消" onclick="window.close()">
      </td>
    </tr>
  </table>
</form>
</body>
</html>
<?php
}
?>
###############
# setup.php
# 此为初始化程序,只在上传后第一次执行,之后必须delete,以免出错
#################
<?php
require "func.php";
echo "<h1>初始化数据库</h1><br><br>";
echo "建立数据库连接...ok!<br>";
echo "建立表 boardinfo...";
&#36;sql="create table boardinfo (name varchar(50) not null, chinesename varchar(50) not null)";
mysql_query(&#36;sql) or die("错误");
echo "ok!<br>";
echo "建立表 user...";
&#36;sql="create table user (id int(11) not null auto_increment, name varchar(50) not null, sex varchar(6), realname varchar(20), password varchar(16) not null, address varchar(40), oicq varchar(10), homepage  varchar(50), score int(11), phone varchar(20), email varchar(50), regtime varchar(20), qm text,  slaveboard varchar(50), primary key (id))";
mysql_query(&#36;sql) or die("错误");
echo "ok!<br>";
echo "建立表 message... ";
&#36;sql="create table message (id int(11) not null auto_increment,    name varchar(50), fromname varchar(50), writetime varchar(20), cont longtext, primary key(id))";
mysql_query(&#36;sql) or die("错误");
echo "ok!<br>";
echo "初始化版面 “个人电脑”...";
create_board_table(&#39;computer&#39;,&#39;个人电脑&#39;);
echo "ok!<br><br>";
echo "<h2>设置完毕!</h2>";
echo "<br><br>冷情疯子(电脑疯子)";
?>
## userinfo.php
<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="#ffffff" background="image/bg.gif">
<?php include "header.php";
if (!isset(&#36;name)) {
?>
<form method="post" action="<?php echo &#36;php_self;?>">
  <table width="90%" border="1" cellspacing="0" cellpadding="1" align="center" bordercolorlight="#cccccc" bordercolordark="#ffffff">
    <tr align="center">  
      <td>请输入欲察看的用户名</td>
    </tr>
    <tr align="center">  
      <td>
        <input type="text" name="name" size="18" maxlength="16">
      </td>
    </tr>
    <tr align="center">  
      <td>
        <input type="submit" name="b1" value="察看资料">
      </td>
    </tr>
  </table>
</form>
<?php
}
else {
    require "func.php";
    if (is_user_exits(&#36;name)) {
        &#36;sql="select * from user where name=&#39;&#36;name&#39;";
        &#36;sql_result=mysql_query(&#36;sql);
        &#36;row=mysql_fetch_array(&#36;sql_result);
?>
<br>
<table width="90%" border="1" cellspacing="0" cellpadding="1" align="center" bordercolorlight="#cccccc" bordercolordark="#ffffff">
  <tr>
    <td><b>详细资料</b></td>
  </tr>
  <tr>
    <td>用户名:<?php echo &#36;row[name];?></td>
  </tr>
  <tr>
    <td>真实姓名:<?php echo &#36;row[realname];?></td>
  </tr>
  <tr>
    <td>性别:<?php echo &#36;row[sex];?></td>
  </tr>
  <tr>
    <td>地址:<?php echo &#36;row[address];?></td>
  </tr>
  <tr>
    <td>电话:<?php echo &#36;row[phone];?></td>
  </tr>
  <tr>
    <td>oicq:<?php echo &#36;row[oicq];?></td>
  </tr>
  <tr>
    <td>email:<a href="mailto:<?php echo &#36;row[email];?>"><?php echo &#36;row[email];?></a></td>
  </tr>
  <tr>
    <td>主页:<a href="<?php echo &#36;row[homepage];?>" target="_blank"><?php echo &#36;row[homepage];?></a></td>
  </tr>
  <tr>
    <td>注册时间:<?php echo &#36;row[regtime];?></td>
  </tr>
  <tr>
    <td>目前积分:<?php echo &#36;row[score];?></td>
  </tr>
</table>
<br>
<?php
        }
        else {
            echo "请输入正确合法存在的用户名称";
        }
}
include "footer.php";?>
</body>
</html>
# viewmsg.php
<?php
require "func.php";
if (is_user_exits(&#36;jl_forum[name]) and check_user_password(&#36;jl_forum[name],&#36;jl_forum[password])) {
    if (isset(&#36;job)) {
        if (is_this_user(&#36;id)) {
            delmsg(&#36;id);
        }
    }
    &#36;name=&#36;jl_forum[name];
    &#36;sql="select * from message where name=&#39;&#36;name&#39;";
    &#36;sql_result=mysql_query(&#36;sql);
    &#36;sum=mysql_num_rows(&#36;sql_result);
?>
<html>
<head>
<title>察看留言</title>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="css/index.css">
<script language="javascript">
function sendmsg(name){                window.open("sendmsg.php?name="+name,"","height=200,width=500,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");
}
</script>
</head>

<body bgcolor="#ffffff" background="image/bg.gif">
<p>您目前共有 <b><?php echo &#36;sum;?></b> 条留言</p>
<table width="98%" border="1" cellspacing="0" cellpadding="0" bordercolorlight="#cccccc" bordercolordark="#ffffff">
<?php
while (&#36;sql_row=mysql_fetch_array(&#36;sql_result)) {
?>
  <tr bgcolor="#eeeeee">  
    <td><a href="javascript:sendmsg(&#39;<?php echo &#36;sql_row[fromname];?>&#39;)"><?php echo &#36;sql_row[fromname];?></a>  
      于 <?php echo &#36;sql_row[writetime];?> <a href="<?php echo "&#36;php_self?job=del&id=&#36;sql_row[id]";?>">删除</a></td>
  </tr>
  <tr>
    <td><?php echo &#36;sql_row[cont];?></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
<?php
}
?>
</table>
<p>&nbsp; </p>
</body>
</html>
<?php
}
else {
    show_error(4);
}
?> 

转自:动态网制作指南 www.knowsky.com


 


关键字 本文所属关键字

相关 与本文相关文章

分类 所有文章关键字导航

源码编程相关

Java   Asp   PHP   .Net   XML   C/C++   CGI   VB   Jsp   J2ee   J2se   J2me   EJB   Servlet   Tomcat   Resin   Struts   Weblogic   Eclipse   ANT   GUI   JMS   Web servise   IDEA   Webphere   Hibernate   Spring   Jboss   Applet   Swing   Socket   Javamail   Perl   Ajax   P2P   安全   模式   框架   测试   开源   游戏

SQL数据库相关

My-SQL   Ms-SQL   Access   DB2   Oracle   Sybase   SQLserver   索引   存储过程   加密   数据库   分页   视图  

手机无线相关

3G   Wap   CDMA   GRPS   GSM   IVR   彩信   短信   无线   增值业务

网页设计制作相关

HTML   CSS   网页配色   网页特效   Javascript   VBscript   Dreamweaver   Frontpage   JS   Web   网站设计

网站建设推广相关

建站经验   网站优化   网站排名   推广   Alexa

操作系统/服务器相关

Windows XP   Windows 2000   Windows 2003   Windows Me   Windows 9.x   Linux   UNIX   注册表   操作系统   服务器   应用服务器

图形图像多媒体相关

Photoshop   Fireworks   Flash   Coreldraw   Illustrator   Freehand   Photoimpact   多媒体   图形图像

标准 网站致力的规范

Valid CSS!

无不良内容,无不良广告,无恶意代码

Valid XHTML 1.0 Transitional

creativecommons