> 백엔드 개발 > PHP 튜토리얼 > 模仿OSO的论坛(四)_PHP教程

模仿OSO的论坛(四)_PHP教程

WBOY
풀어 주다: 2016-07-21 16:02:15
원래의
1054명이 탐색했습니다.

reply.php(用来回复主题)

疑难问题

if (!$cook_user)
{echo "";}
else {include ("connect.inc.php");
$query = "select * from my_user where user='".$cook_user."' and password='".$cook_password."'";  
$res = mysql_query($query);  
if (!$res)
{echo "";}
include "connect.inc.php";
if ($content) {$content= str_replace ( "'","mysinglequotes",$content);  
$content=htmlspecialchars($content);
$content=nl2br($content);
$query = "INSERT INTO guestbook (name,type,content,icon,time_open,time_close,answer_count,answer_name,main_id) VALUES ('".$cook_user."',0,'".$content."',".$icon.",now(),now(),1,'".$cook_user."',".$theme_id.")";  
$res = mysql_query($query);
if ($res)  
{$query = "update guestbook set time_close=now(),answer_count=answer_count+1,answer_name='".$cook_user."' where id=".$theme_id;  
$res = mysql_query($query);  
if ($res)
{echo "";}}}}
?>




  
    
      
        
        
          
          
        
          
          
        
          
          
        
          
          
               
        
          
回复主题

            href="read.php?theme_id=">
$query = "select theme from guestbook where id=".$theme_id;
$res = mysql_query($query);  
$row = mysql_fetch_row($res);  
echo $row[0];
?>


表情图标 模仿OSO的论坛(四)_PHP教程            align=ABSCENTER height=18  
            src="mypic/icon1.gif"  
            width=18> 模仿OSO的论坛(四)_PHP教程            align=ABSCENTER height=18  
            src="mypic/icon2.gif"  
            width=18> 模仿OSO的论坛(四)_PHP教程            align=ABSCENTER height=18  
            src="mypic/icon3.gif"  
            width=18> 模仿OSO的论坛(四)_PHP教程            align=ABSCENTER height=18  
            src="mypic/icon4.gif"  
            width=18> 模仿OSO的论坛(四)_PHP教程            align=ABSCENTER height=18  
            src="mypic/icon5.gif"  
            width=18> 模仿OSO的论坛(四)_PHP教程            align=ABSCENTER height=18  
            src="mypic/icon6.gif"  
            width=18> 模仿OSO的论坛(四)_PHP教程            align=ABSCENTER height=18  
            src="mypic/icon7.gif"  
            width=18>
模仿OSO的论坛(四)_PHP教程            align=ABSCENTER height=18  
            src="mypic/icon8.gif"  
            width=18> 模仿OSO的论坛(四)_PHP教程            align=ABSCENTER height=18  
            src="mypic/icon9.gif"  
            width=18> 模仿OSO的论坛(四)_PHP教程            align=ABSCENTER height=18  
            src="mypic/icon10.gif"  
            width=18> 模仿OSO的论坛(四)_PHP教程            align=ABSCENTER height=18  
            src="mypic/icon11.gif"  
            width=18> 模仿OSO的论坛(四)_PHP教程            align=ABSCENTER height=18  
            src="mypic/icon12.gif"  
            width=18> 模仿OSO的论坛(四)_PHP教程            align=ABSCENTER height=18  
            src="mypic/icon13.gif"  
            width=18> 模仿OSO的论坛(四)_PHP教程            align=ABSCENTER height=18  
            src="mypic/icon14.gif"  
            width=18>

          加贴内容
    
                  



            
  • 本主题最后 5 个帖子 (按发帖时间倒序排列)

  •             width=100%>
            
            
              
              
    $query = "select * from guestbook where main_id=".$theme_id." or id=".$theme_id." order by time_open DESC limit 5 ";
    $res = mysql_query($query);  
    function TdBackColor() {
      static $ColorStr;
      if ($ColorStr=="#ededed") {
        $ColorStr="#dedede";
      } else {
        $ColorStr="#ededed";
      }
      return($ColorStr);
    }
    for ($i=1;$i{$row = @mysql_fetch_array($res);  
    if (!$row) break;  
    $ColorStr=TdBackColor();
    echo "";
    echo "";  
    $content= str_replace ( "mysinglequotes","'",$row['content']);  
    echo "";  
    }
    ?>      
    作 者 内 容
    ".$row['name']."".$content."



      

    【本文版权归作者与奥索网共同拥有,如需转载,请注明作者及出处】    

    www.bkjia.comtruehttp://www.bkjia.com/PHPjc/316586.htmlTechArticlereply.php(用来回复主题) HTMLHEADTITLE疑难问题/TITLE LINK href=mypic/style.css rel=STYLESHEET type=text/css/HEAD ?php if (!$cook_user) {echo script language='javascript'; e...
    원천:php.cn
    본 웹사이트의 성명
    본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
    인기 튜토리얼
    더>
    최신 다운로드
    더>
    웹 효과
    웹사이트 소스 코드
    웹사이트 자료
    프론트엔드 템플릿