BBS(php & mysql)完整版(一)

2016-01-29 14:34 4 1 收藏

BBS(php & mysql)完整版(一),BBS(php & mysql)完整版(一)

【 tulaoshi.com - PHP 】

  //此页面为say.php
<?
include "signup/mysql.inc";
if($id1){
       $sql="select * from $table where id='$id1'";    //显示回复题目
       $result=mysql_query($sql)or die(mysql_error());
       $row=mysql_fetch_array($result);
       $title="RE:".$row["title"];

        }

$ip=$REMOTE_ADDR;
$sql="select * from user_stus where ip='$ip'";    //查询当前用户名
$result=mysql_query($sql)or die(mysql_error());
$row=mysql_fetch_array($result);

if(!$row)                                         //判断用户是否登陆
{

echo "<html<div id=Layer2  align=center z-index:1<BR<BR<BR<BR";
echo"<div id=Layer3  align=center z-index:2<img src="/attachment/portal/jcwcj/2005-12/10/05121010212817708.gif" width=15 height=15echo"  <div align=center";  
echo"<p<font size=2 color=#FF33CC嘻嘻!! 请先登陆echo"<p<font size=2 color=#FF33CC<a href='".$PHP_SELF."?p=1&&table=$table'返回
exit();
}

else $userid=$row["userid"];


if($ok)
{

    if($title==""||$content=="")
    {
        echo "<BR      请您添完整后提交";
         
    }
    else{
    $id=time();                                 //提交文章
    $date1=date("Y/m/d");
    $title=htmlspecialchars($title);
    $content=htmlspecialchars($content);

    $sql="select * from ".$table;
    $result=mysql_query($sql)or die(mysql_error());
    $row1=mysql_num_rows($result);
    $row1++;
     
    if($id1){
         
    $sql="insert into bbs_re (id,userid,date1,title,content)values('$id','$userid','$date1','$title','$content')";
    mysql_query($sql)or die(mysql_error());
    $sql="select * from ".$table." where id='$id1'";
    $result=mysql_query($sql)or die(mysql_error());
    $lin=mysql_fetch_array($result);
    for($i=1;$i<6;$i++)
        {
         $re="r".$i;
         if(!$lin["$re"])
         break;
        }
    $sql="update ".$table." set ".$re."='$id' where id='$id1'";

           }
&nb

(本文来源于图老师网站,更多请访问https://www.tulaoshi.com/php/)

来源:https://www.tulaoshi.com/n/20160129/1493670.html

延伸阅读
标签: Web开发
+proto.menuBorder;             var focusItem = body.document.layers[n];             focusItem.clip.width = body.clip.width;             f...
标签: Web开发
//下面是  top.js       function KB_keepItInIE(theName,theWantTop,theWantLeft) { theRealTop=parseInt(document.body.scrollTop) theTrueTop=theWantTop+theRealTop document.all[theName].style.top=theTrueTop theRealLeft=parseInt(document.body.scrollLeft) theTrueLeft=theWantLeft+th...
标签: Web开发
//此页面为 top.php html head titleUntitled Document/title meta http-equiv="Content-Type" content="text/html; charset=gb2312" script language="JavaScript1.2" src="js/fw_menu.js"/script script language="JavaScript1.2" src="js/menu_comment.js"/script /he...
标签: Web开发
//此页面为php3.php ? include "signup/mysql.inc"; switch($part){    case "1" :$table="bbs_php";break;    case "2" :$table="bbs_mysql";break;    case "3" :$table="bbs_html";break;    ca...
标签: Web开发
//下面为menu_comment.js function fwLoadMenus() {   if (window.fw_menu_0) return;   window.fw_menu_0 = new Menu("root",92,20,"Verdana, Arial, Helvetica, sans-serif",12,"#6666ff","#ffffff","#FF9999","#6666ff");   fw_menu_0.addMe...

经验教程

858

收藏

51
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部