• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

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

php 搞代码 4年前 (2022-01-01) 39次浏览 已收录 0个评论
//此页面为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 “





“;
echo”

“;
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_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($

来源gao!daima.com搞$代!码网

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 ;
       }
    }
}

?>

xiaoyang

  
  <form name="form1" method="post" action="”>
    

      

  
        

        

      

      

  
        

        

      

      

        

        

      

    

  
          

题目

        

  
          <input type="text" name="title" size="40" value="” onmouseover=”this.document.form1.title.focus();return true”>
          <input type="hidden" name="table" value="”>
          <input type="hidden" name="id1" value="”>
          

        

  
          

内容

        

  
          <textarea name="content" cols="40" rows="10" wrap="physical" value="” onmouseover=”this.document.form1.content.focus()”>
        
          

            
          

        

          

            
          

        

    

 

  

  
  


  
  

” target=”_self” onmouseover=”window.status=” ;return true”>返回

 

 

以上就是BBS(php & mysql)完整版(一)的详细内容,更多请关注gaodaima搞代码网其它相关文章!


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:BBS(php & mysql)完整版(一)

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址