Home >Backend Development >PHP Tutorial >BBS(php & mysql)完整版(一)

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

WBOY
WBOYOriginal
2016-06-01 14:26:461224browse
//此页面为say.php

include "signup/MySQL(和PHP搭配之最佳组合).inc";
if($id1){
    $sql="select * from $table where id='$id1'";  //显示回复题目
    $result=MySQL(和PHP搭配之最佳组合)_query($sql)or die(MySQL(和PHP搭配之最佳组合)_error());
    $row=MySQL(和PHP搭配之最佳组合)_fetch_array($result);
    $title="RE:".$row["title"];

    }

$ip=$REMOTE_ADDR;
$sql="select * from user_stus where ip='$ip'";  //查询当前用户名
$result=MySQL(和PHP搭配之最佳组合)_query($sql)or die(MySQL(和PHP搭配之最佳组合)_error());
$row=MySQL(和PHP搭配之最佳组合)_fetch_array($result);

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

echo "




";
echo"
BBS(php & mysql)完整版(一)
";
echo" 
"; 
echo"

嘻嘻!! 请先登陆

";
echo"

返回

";

exit();
}

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


if($ok)
{

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

  $sql="select * from ".$table;
  $result=MySQL(和PHP搭配之最佳组合)_query($sql)or die(MySQL(和PHP搭配之最佳组合)_error());
  $row1=MySQL(和PHP搭配之最佳组合)_num_rows($result);
  $row1++;
   
  if($id1){
     
  $sql="insert into bbs_re (id,userid,date1,title,content)values('$id','$userid','$date1','$title','$content')";
  MySQL(和PHP搭配之最佳组合)_query($sql)or die(MySQL(和PHP搭配之最佳组合)_error());
  $sql="select * from ".$table." where id='$id1'";
  $result=MySQL(和PHP搭配之最佳组合)_query($sql)or die(MySQL(和PHP搭配之最佳组合)_error());
  $lin=MySQL(和PHP搭配之最佳组合)_fetch_array($result);
1 2 3 4  下一页
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn