社区(php&&mysql)三_PHP教程

WBOY
풀어 주다: 2016-07-21 16:05:57
원래의
2081명이 탐색했습니다.

function prev_subj($id){
    $DROOT=getenv('DOCUMENT_ROOT');
    include("sql.php3");
    $db=mysql_connect($sql['host'], $sql['user'] , $sql['passwd']);  
    $qstr="select id,aid from bbs_subj where id='$id'";
    $rs=mysql_db_query($sql['db'],$qstr);     
    $row=mysql_fetch_array($rs);
    $aid=$row['aid'];

    $qstr="select id from bbs_subj where aid='$aid' order by wdate DESC";
    $rs=mysql_db_query($sql['db'],$qstr);
    $pid=$id;     
    while($row=mysql_fetch_array($rs)){
        $tid=$row['id'];     
        if($id==$tid) break;
        $pid=$tid;
    }

    return $pid;
}
// 絞
function next_subj($id){
    $DROOT=getenv('DOCUMENT_ROOT');
    include("sql.php3");
    $db=mysql_connect($sql['host'], $sql['user'] , $sql['passwd']);  
    $qstr="select id,aid from bbs_subj where id='$id'";
    $rs=mysql_db_query($sql['db'],$qstr);     
    $row=mysql_fetch_array($rs);
    $aid=$row['aid'];

    $qstr="select id from bbs_subj where aid='$aid' order by wdate DESC";
    $rs=mysql_db_query($sql['db'],$qstr);
    $pid=$id;     
    while($row=mysql_fetch_array($rs)){
        $pid=$row['id'];     
        if($id==$pid) break;
    }
    if($row=mysql_fetch_array($rs)) {
        $pid=$row['id'];
    }
    return $pid;
}

//======================================================================
function viewbar() {
    global $pgno;
    global $PHP_SELF;
    global $aid,$sid;
    //global $OPEN_LIST;
    echo "

";
    echo "";

    echo "
";
        $nextid=next_subj($sid);
        $previd=prev_subj($sid);
        echo "[夹肈跋]";
        echo "[莱セ絞]";
        echo "[祇穝ゅ彻]";
        echo "[絞]";
        echo "[絞]";
        //echo "[程絞]";

    echo "
";     

}
//======================================================================
function view() {
    global $PHP_SELF,$aid,$sid,$rid;
    global $c_poster,$c_email;
    //echo "$PHP_SELF,$aid,$sid,$rid,$pgno";
    $type=0; //秨穝杠肈
  if($sid && $rid) {
      addhitviews($sid,$rid);
    $type=1; //莱
    $db_table="bbs_subj";
    if($sid!=$rid)    $db_table="bbs_docs";
    $DROOT=getenv('DOCUMENT_ROOT');
    include("sql.php3");
    $db=mysql_connect($sql['host'], $sql['user'] , $sql['passwd']);  
    $qstr="select banner from bbs_area where id='$aid'";
    $rs=mysql_db_query($sql['db'],$qstr);
    echo mysql_error();
    $row=mysql_fetch_array($rs);
    $abanner=$row['banner'];

    $qsql="SELECT * from $db_table where id='$rid' ";
    $rs=mysql_db_query($sql['db'],$qsql);
    $row=mysql_fetch_array($rs);
    $poster=$row['poster'];
    $pip=$row['pip'];
    $wdate=$row['wdate'];
    $rebanner=$banner=$row['banner'];
    $body=$row['body'];
    $body=htmlspecialchars($body);
    $pbody=ereg_replace("n","
",$body);
    $pbody =preg_replace( "/[www *]([\x0-\xff]*?)[/www *]/", '\1', $pbody );  
    $pbody =preg_replace( "/[www +([a-zA-Z0-9.:/_-]+)]([\x0-\xff]*?)[/www *]/", '\2', $pbody );  

    echo "
";
    echo "[$abanner]
";
    echo "$banner
";
    echo "";
            echo "";
            echo "";
            echo "";
            echo "";
        echo "
";
                viewbar();
            echo "
";
            //====ゅ彻==============
            echo "";
            echo "";
                echo "";
                echo "";
            echo "";
            echo "";
                echo "";
                echo "";
            echo "";
            echo "";
                echo "";
                echo "";
            echo "";
            echo "";
            echo "
";
                    echo ":";
                echo "
";
                    echo $poster;
                echo "
";
                    echo "ㄓ:";
                echo "
";
                    echo $pip;
                echo "
";
                    echo "ゅ彻ず甧:";
                echo "
";
                            echo $pbody;
                            echo "
";
                echo "
";
            echo "
";

                //=======籔狟ねだㄉ===============
                echo "";     
                echo "";
                echo "";
                echo "";
                echo "";
                echo "";
                echo "";
                    echo "";
                       echo "";
                       echo "";
                    echo "";
                echo "";     
                echo "";                 
            echo "
";
                //=======mail List===============
            echo "";     
            echo "";
                echo "";
                echo "";
                echo "";
                echo "";
                echo "";

            echo "";
               echo "";
               echo "";
            echo "";     
            echo "";
            echo "";     

            echo "
";
                viewbar();
            echo "
";

         
待续........
         

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/315609.htmlTechArticlefunction prev_subj($id){ $DROOT=getenv('DOCUMENT_ROOT'); include(sql.php3); $db=mysql_connect($sql['host'], $sql['user'] , $sql['passwd']); $qstr=select id,aid from bbs_subj where i...
관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿