选择显示字体大小

一个简单的mysql数据浏览器

程序三:readforum.php

<html>
<head>
<title> 论坛信息 </title>
<link rel="stylesheet" type="text/css" href="fp_zhangcg.css">
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<meta name="microsoft theme" content="none">
<meta name="microsoft border" content="none">
<meta name="generator" content="editplus">
<meta name="author" content="">
<meta name="keywords" content="">
<meta name="description" content="">
</head>
<body bgcolor="#c0c0c0" background="backcolor.gif">

<?
  include ("c:mydbheader.inc");
?>

<?php  
//完成功能:

//echo &#36;username;
//echo &#36;useremail;
//echo &#36;userhttp;
//echo &#36;forumtitle;
//echo &#36;fouumface;
//echo &#36;forumcontent;  
//echo &#36;theme_id;

echo &#39;g_username:&#39;.&#36;globals["g_username"].&#39; is ok&#39;;
&#36;dbh = mysql_connect(&#39;localhost:3306&#39;,&#39;root&#39;,&#39;&#39;);
mysql_select_db(&#39;test&#39;);  
if (empty(&#36;readflag)) {
   &#36;readflag = 0;
}  
if (&#36;readflag > 0) {
   &#36;theme_id = &#36;readflag;
}

if (empty(&#36;theme_id)) {
   &#36;theme_id = 0;
}  
  
//echo &#36;username;
//echo &#36;useremail;
//echo &#36;userhttp;
//echo &#36;forumtitle;
//echo &#36;fouumface;
//echo &#36;forumcontent;  

if ((&#36;readflag == 0) and (&#36;theme_id == 0)) {   //增加数据
    if (empty(&#36;username)) {
       print "错误,请核对数据";
    }
     &#36;res=mysql_query("select max(id) + 1 as rid from fr_t_forumtitle",&#36;dbh);   
    &#36;row=mysql_fetch_array(&#36;res);
    if (empty(&#36;row["rid"])) {
       &#36;theme_id = 1;   
    } else {
      &#36;theme_id = &#36;row["rid"] + 1;   
    }
    &#36;tempstr = " insert into fr_t_forumtitle(id,state,readcount,replycount,title,";
    &#36;tempstr = &#36;tempstr."createman,replytime) ";
    &#36;tempstr = &#36;tempstr." values(".&#36;theme_id.",&#39;0&#39;,0,-1,&#39;".&#36;forumtitle."&#39;,&#39;".&#36;username."&#39;,now());";
    &#36;res=mysql_query(&#36;tempstr,&#36;dbh);
}
if (&#36;readflag == 0 ) {
    &#36;forumcontent =  nl2br(&#36;forumcontent);
    &#36;tempstr = " insert into fr_t_forumcontent(id,content,replyman,replyemail,";
    &#36;tempstr = &#36;tempstr."replyhttp,replytime,replyface)";
    &#36;tempstr = &#36;tempstr." values(".&#36;theme_id.",&#39;".&#36;forumcontent."&#39;,&#39;".&#36;username."&#39;,&#39;".
        &#36;useremail."&#39;,&#39;".&#36;userhttp."&#39;,now(),".&#36;forumface.");";
    &#36;res=mysql_query(&#36;tempstr,&#36;dbh);
    &#36;tempstr = " update fr_t_forumtitle set readcount = readcount +1,replycount = replycount + 1,";
    &#36;tempstr = &#36;tempstr."replytime = now(),replyman =&#39;".&#36;username."&#39; where id=".&#36;theme_id;  
    &#36;res=mysql_query(&#36;tempstr,&#36;dbh);
} else {
    &#36;tempstr = " update fr_t_forumtitle set readcount = readcount +1 where id =".&#36;theme_id;
    &#36;res=mysql_query(&#36;tempstr,&#36;dbh);
}
?>

<table width="100%" border="0">
<tr class="text">  
<td width="50%">  <div align="left">当前位置:主页——论坛——论坛内容</div> </td>
<td width="50%">  <div align="center">&nbsp</div> </td>
</table>
  
<?
    &#36;tempstr = " select title,readcount,replycount from fr_t_forumtitle where id = ".&#36;theme_id;
     &#36;res=mysql_query(&#36;tempstr,&#36;dbh);   
    &#36;row=mysql_fetch_array(&#36;res);   
    &#36;ls_theme_title = &#36;row["title"];   
    &#36;li_readcount   = &#36;row["readcount"];   
    &#36;li_replycount  = &#36;row["replycount"] + 1;   
?>

<table width="100%" border="0">
  <tr>  
    <td width="61%" class="text">主题:<span class="text"><font color="#ff0000">
      <?
        print &#36;ls_theme_title;
      ?>
    </font></span></td>
    <td width="13%">  
      <div align="center"><a href="addforum.php?theme_id=0" target="_top"><img src="post.gif" width="80" height="20" alt="加新贴字" border="0"></a></div>
    </td>
    <td width="13%">  
    <?
      print &#39;<div align="center"><a href="addforum.php?theme_id=&#39;.&#36;theme_id.&#39;"&#39;;
      print &#39;target="_top"><img src="reply.gif" width="80" height="20"&#39;;
      print &#39;alt="回复贴字" border="0"></a></div>&#39;;
    ?>
    </td>
    <td width="13%">  
      <div align="center"><a href="mainforum.php" target="_top"><img src="theme.gif" width="80" height="20" alt="主题列表" border="0"></a></div>
    </td>
  </tr>
  <tr>  
    <td width="390" class="text">共有帖子 <font color="#ff0000">
    <?
     print &#36;li_replycount;
    ?>
    </font> 个,已阅读 <font color="#ff0000">
    <?
     print &#36;li_readcount;
    ?>
    </font> 次</td>
    <td colspan="3">&nbsp;</td>
  </tr>
</table>
<?
//显示帖子的所有内容
&#36;ls_query = &#39;select content,replyman,replytime,replyemail,replyhttp,replyface from fr_t_forumcontent &#39;;
&#36;ls_query =  &#36;ls_query. &#39; where id = &#39;.&#36;theme_id.&#39; order by replytime&#39;;
&#36;res = mysql_query(&#36;ls_query, &#36;dbh);  
&#36;li_tempr = 0;
while (&#36;row = mysql_fetch_array(&#36;res)) {  
  if (&#36;li_tempr == 0) {
  &#36;li_tempr = 1;   
  print &#39;<table width="100%" border="0" bgcolor="#cccccc">&#39;;
  print &#39;  <tr bgcolor="#dedede" bordercolor="#ccccff"> &#39;;

  print &#39; <td class="text" height="19" valign="top" width="5%"> <div align="left">&#39;;
  print &#39;  <img src="icon&#39;.&#36;row["replyface"].&#39;.gif" width="18" height="18" ></div> </td>&#39;;
   
  print &#39;    <td class="text" height="19" valign="top" width="20%"> &#39;;
  print &#39;      <div align="left"><font color="#3333ff">作者:&#39;.&#36;row["replyman"].&#39;</font></div>&#39;;
  print &#39;    </td>&#39;;
  print &#39;    <td class="text" height="19" valign="top" width="25%">&#39;;
  print  &#39; <font color="#3333ff">发表于:&#39;.&#36;row["replytime"].&#39;</font></td>&#39;;
  print &#39;    <td class="text" height="19" valign="top" width="25%">&#39;;
  print &#39; <font color="#3333ff">e_mail:&#39;.&#36;row["replyemail"].&#39;</font></td>&#39;;
  print &#39;    <td class="text" height="19" valign="top" width="25%">&#39;;
  print &#39;<font color="#3333ff">&#39;.&#36;row["replyhttp"].&#39; </font></td>&#39;;
  print &#39;  </tr>&#39;;
  print &#39;  <tr bgcolor="#dedede" bordercolor="#ccccff"> &#39;;
  print &#39;    <td class="text" height="22" valign="top" colspan="5"> &#39;;
  print &#39;      <p><font color="#3333ff">&#39;.&#36;row["content"].&#39;</font></p>&#39;;
  print &#39;    </td>&#39;;
  print &#39;  </tr>&#39;;
  print &#39;</table>&#39;;
  }
  else {
&#36;li_tempr = 0;   
print &#39;<table width="100%" border="0" bgcolor="#cccccc">&#39;;
print &#39;  <tr bgcolor="#ededed"> &#39;;
print &#39; <td class="text" height="19" valign="top" width="5%"> <div align="left">&#39;;
print &#39;  <img src="icon&#39;.&#36;row["replyface"].&#39;.gif" width="18" height="18" ></div> </td>&#39;;
print &#39;    <td class="text" height="19" valign="top" width="20%" bgcolor="#ededed"> &#39;;
print &#39;      <div align="left"><font color="#000099">作者:&#39;.&#36;row["replyman"].&#39;</font></div>&#39;;
print &#39;    </td>&#39;;
print &#39;    <td class="text" height="19" valign="top" width="25%">&#39;;
print &#39; <font color="#000099">发表于:&#39;.&#36;row["replytime"].&#39; </font></td>&#39;;
print &#39;    <td class="text" height="19" valign="top" width="25%">&#39;;
print &#39;<font color="#000099">e_mail:&#39;.&#36;row["replyemail"].&#39;</font></td>&#39;;
print &#39;    <td class="text" height="19" valign="top" width="25%">&#39;;
print &#39;<font color="#000099">&#39;.&#36;row["replyhttp"].&#39; </font></td>&#39;;
print &#39;  </tr>&#39;;
print &#39;  <tr bgcolor="#ededed"> &#39;;
print &#39;    <td class="text" height="22" valign="top" colspan="5"> &#39;;
print &#39;      <p><font color="#000099">&#39;.&#36;row["content"].&#39;</font></p>&#39;;
print &#39;    </td>&#39;;
print &#39;  </tr>&#39;;
print &#39;</table>&#39;;
}
}
?>

<?
  include ("c:mydbfooter.inc");
?>
</html>

----------
http://zhangcg.yeah.net  


 


关键字 本文所属关键字

相关 与本文相关文章

分类 所有文章关键字导航

源码编程相关

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