国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數據庫 > MySQL > 正文

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

2024-07-24 12:56:44
字體:
來源:轉載
供稿:網友
//此頁面為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=http://edu.cnzz.cn/newsinfo/pic/3.gif width=15 height=15></div>";
echo"  <div align=center>";  
echo" <p><font size=2 color=#ff33cc>嘻嘻!! 請先登陸</font></p>";
echo"<p><font size=2 color=#ff33cc><a href='".$php_self."?p=1&&table=$table'>返回</a></font></p> </div> </html>";

exit();
}

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


if($ok)
{

    if($title==""||$content=="")
    {
        echo "<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;請您添完整后提交";
         
    }
    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'";

           }
    else   
    $sql="insert into ".$table." (id,userid,date1,title,content,row)values('$id','$userid','$date1','$title','$content','$row1')";
    $result=mysql_query($sql)or die(mysql_error());


    if($result)
       {
      
        header("location:php3.php?p=1&&table=$table");
        exit ;
       }
    }
}


?>


<html>
<head>
<title>xiaoyang</title>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<script language="javascript1.2" src="js/menu_comment.js"></script>
<script language="javascript1.2" src="js/fw_menu.js"></script>
<script language="javascript">
<!--
function mm_reloadpage(init) {  //reloads the window if nav4 resized
  if (init==true) with (navigator) {if ((appname=="netscape")&&(parseint(appversion)==4)) {
    document.mm_pgw=innerwidth; document.mm_pgh=innerheight; onresize=mm_reloadpage; }}
  else if (innerwidth!=document.mm_pgw || innerheight!=document.mm_pgh) location.reload();
}
mm_reloadpage(true);
// -->
</script>
</head>

<body bgcolor="#ffffff" text="#000000">
<div id="layer1" >
<script language="javascript1.2">fwloadmenus();</script></div>




   
<div id="layer6" ></div>
<div id="layer5" >  
  <form name="form1" method="post" action="<? echo $php_self ?>">
    <table width="98%" border="1" cellspacing="0" cellpadding="0" bordercolor="#ff99ff">
      <tr>  
        <td width="26%" height="42">  
          <div align="center"><font size="2" color="#ff33ff">題目</font></div>
        </td>
        <td width="74%" height="42">  
          <input type="text" name="title" size="40" value="<?echo $title ;?>" onmouseover="this.document.form1.title.focus();return true">
          <input type="hidden" name="table" value="<?echo $table ;?>">
          <input type="hidden" name="id1" value="<? echo $id1 ;?>">
          <br>
        </td>
      </tr>
      <tr>  
        <td width="26%" height="172">  
          <div align="center"><font size="2" color="#ff33ff">內容</font></div>
        </td>
        <td width="74%" height="172">  
          <textarea name="content" cols="40" rows="10" wrap="physical" value="<?echo $content ;?>" onmouseover="this.document.form1.content.focus()"></textarea>
        </td>
      </tr>
      <tr>
        <td width="26%">
          <div align="center">
            <input type="reset" name="submit2" value="重寫">
          </div>
        </td>
        <td width="74%">
          <div align="center">
            <input type="submit" name="ok" value="發表">
          </div>
        </td>
      </tr>
    </table>
    <p>&nbsp;</p>
  </form>
</div>
<div id="back" >  
  <hr color="#ff9999" noshade>
</div>
<div id="goback" >  
  <div align="center"><a href="php3.php?p=1&&table=<?echo $table ;?>" target="_self" onmouseover="window.status='' ;return true"><font size="2" color="#ff33ff">返回</font></a></div>
</div>
<p>&nbsp;</p>
<p>&nbsp;</p>
</body>
</html>


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 盐边县| 海淀区| 甘德县| 兴义市| 龙川县| 安庆市| 潮安县| 永宁县| 铜鼓县| 大新县| 钟山县| 东乡族自治县| 阿城市| 康马县| 汽车| 遵义县| 奉节县| 建阳市| 红桥区| 博白县| 金秀| 贵港市| 广河县| 永泰县| 凤山县| 中江县| 澄迈县| 枝江市| 九龙坡区| 平湖市| 吴江市| 蒙城县| 凉城县| 鞍山市| 北京市| 吉水县| 沂源县| 海南省| 太康县| 双流县| 绍兴市|