一個(gè)模仿oso的php論壇程序源碼(之三)第1/2頁
<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 $username;
//echo $useremail;
//echo $userhttp;
//echo $forumtitle;
//echo $fouumface;
//echo $forumcontent;
//echo $theme_id;
echo 'g_username:'.$GLOBALS["g_username"].' is ok';
$dbh = mysql_connect('localhost:3306','root','');
mysql_select_db('test');
if (empty($readflag)) {
$readflag = 0;
}
if ($readflag > 0) {
$theme_id = $readflag;
}
if (empty($theme_id)) {
$theme_id = 0;
}
//echo $username;
//echo $useremail;
//echo $userhttp;
//echo $forumtitle;
//echo $fouumface;
//echo $forumcontent;
if (($readflag == 0) and ($theme_id == 0)) { //增加數(shù)據(jù)
if (empty($username)) {
print "錯(cuò)誤,請(qǐng)核對(duì)數(shù)據(jù)";
}
$res=mysql_query("SELECT max(id) + 1 AS rid FROM fr_t_forumtitle",$dbh);
$row=mysql_fetch_array($res);
if (empty($row["rid"])) {
$theme_id = 1;
} else {
$theme_id = $row["rid"] + 1;
}
$tempstr = " insert into fr_t_forumtitle(id,state,readcount,replycount,title,";
$tempstr = $tempstr."createman,replytime) ";
$tempstr = $tempstr." values(".$theme_id.",'0',0,-1,'".$forumtitle."','".$username."',now());";
$res=mysql_query($tempstr,$dbh);
}
if ($readflag == 0 ) {
$forumcontent = nl2br($forumcontent);
$tempstr = " insert into fr_t_forumcontent(id,content,replyman,replyemail,";
$tempstr = $tempstr."replyhttp,replytime,replyface)";
$tempstr = $tempstr." values(".$theme_id.",'".$forumcontent."','".$username."','".
$useremail."','".$userhttp."',now(),".$forumface.");";
$res=mysql_query($tempstr,$dbh);
$tempstr = " update fr_t_forumtitle set readcount = readcount +1,replycount = replycount + 1,";
$tempstr = $tempstr."replytime = now(),replyman ='".$username."' where id=".$theme_id;
$res=mysql_query($tempstr,$dbh);
} else {
$tempstr = " update fr_t_forumtitle set readcount = readcount +1 where id =".$theme_id;
$res=mysql_query($tempstr,$dbh);
}
?>
<table width="100%" border="0">
<tr class="text">
<td width="50%"> <div align="left">當(dāng)前位置:主頁——論壇——論壇內(nèi)容</div> </td>
<td width="50%"> <div align="center"> </div> </td>
</table>
<?
$tempstr = " select title,readcount,replycount from fr_t_forumtitle where id = ".$theme_id;
$res=mysql_query($tempstr,$dbh);
$row=mysql_fetch_array($res);
$ls_theme_title = $row["title"];
$li_readcount = $row["readcount"];
$li_replycount = $row["replycount"] + 1;
?>
<table width="100%" border="0">
<tr>
<td width="61%" class="text">主題:<span class="text"><font color="#ff0000">
<?
print $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 '<div align="center"><a href="addforum.php?theme_id='.$theme_id.'"';
print 'target="_top"><img src="reply.gif" width="80" height="20"';
print 'alt="回復(fù)貼字" border="0"></a></div>';
?>
</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>
相關(guān)文章
PHP unlink與rmdir刪除目錄及目錄下所有文件實(shí)例代碼
這篇文章主要介紹了PHP unlink與rmdir刪除目錄及目錄下所有文件的實(shí)例代碼,需要的朋友可以參考下2018-02-02PHP中最容易忘記的一些知識(shí)點(diǎn)總結(jié)
本篇文章總結(jié)出了一部分,PHP中最容易忘記的一些知識(shí)點(diǎn)。需要的朋友參考下2013-04-04解決laravel 5.1報(bào)錯(cuò):No supported encrypter found的辦法
這篇文章主要給大家介紹了關(guān)于解決laravel 5.1報(bào)錯(cuò):No supported encrypter found的相關(guān)資料,文中介紹的非常詳細(xì),對(duì)大家具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考借鑒,下面來一起看看吧。2017-06-06推薦10個(gè)提供免費(fèi)PHP腳本下載的網(wǎng)站
這篇文章主要介紹了推薦10個(gè)提供免費(fèi)PHP腳本下載的網(wǎng)站,需要的朋友可以參考下2014-12-12PHP file_get_contents函數(shù)讀取遠(yuǎn)程數(shù)據(jù)超時(shí)的解決方法
這篇文章主要介紹了PHP file_get_contents函數(shù)讀取遠(yuǎn)程數(shù)據(jù)超時(shí)的解決方法,本文直接給出解決方法代碼,需要的朋友可以參考下2015-05-05php遞歸函數(shù)三種實(shí)現(xiàn)方法及如何實(shí)現(xiàn)數(shù)字累加
實(shí)現(xiàn)遞歸函數(shù)有哪些方法呢?如何用遞歸函數(shù)實(shí)現(xiàn)數(shù)字累加?這篇文章就主要介紹php遞歸函數(shù)三種實(shí)現(xiàn)方法及如何實(shí)現(xiàn)數(shù)字累加,需要的朋友可以參考下。2015-08-08Laravel框架實(shí)現(xiàn)超簡單的分頁效果示例
這篇文章主要介紹了Laravel框架實(shí)現(xiàn)超簡單的分頁效果,結(jié)合實(shí)例形式分析了Laravel框架實(shí)現(xiàn)分頁功能的相關(guān)控制器、視圖、模板調(diào)用等相關(guān)操作技巧,需要的朋友可以參考下2019-02-02在云虛擬主機(jī)部署thinkphp5項(xiàng)目的步驟詳解
thinkphp官網(wǎng)在去年的時(shí)候發(fā)布了tp的顛覆版本thinkphp5,tp5確實(shí)比之前的版本好用了很多,那么下面這篇文章就來給大家介紹關(guān)于在云虛擬主機(jī)部署thinkphp5項(xiàng)目的相關(guān)資料,需要的朋友可以參考借鑒,下面來一起看看吧。2017-12-12