您现在的位置: 军旅同心 >> 读书赏析 >> 学习园地 >> 电脑网络 >> 技术文章 >> 文章正文
社区(php&&mysql)五
作者:采集员 文章来源:来源于网络 点击数: 更新时间:2005-9-10 14:35:48
function post2() {
    global $sid,$aid,$PHP_SELF;
    global $banner,$body,$poster,$email,$type,$CHAR_GB;
     
     
    if(strlen($banner)==0 || strlen($body)==0 || strlen($poster)==0 || strlen($email)==0) {
        echo "
          <script language=javascript>
            alert('恶?ぃЧ俱');
            history.back();
          </script>
         ";
        return;
    }
     
    //$banner=AddSlashes($banner);
    //$body=AddSlashes($body);
    $rip=getenv('REMOTE_ADDR');

    $DROOT=getenv('DOCUMENT_ROOT');
    include("sql.php3");
    $db=mysql_connect($sql['host'], $sql['user'] , $sql['passwd']);  
    $now=date('Y')."-".date('m')."-".date('d')." ".date('H').":".date('i').":".date('s');
     
    if($CHAR_GB==1) {
        include("CCharset.php3");
        $code=new CCharset;
        $banner=$code->Gb_Big5($banner);
        $body=$code->Gb_Big5($body);
        $poster=$code->Gb_Big5($poster);             
    }
     
    if($type==1) {
        $qsql="INSERT INTO bbs_docs (aid,sid,banner,body,poster,email,pip,wdate)
           values('$aid','$sid','$banner','$body','$poster','$email','$rip','$now')";
    } else {
        $qsql="INSERT INTO bbs_subj (aid,banner,body,poster,email,pip,wdate)
           values('$aid','$banner','$body','$poster','$email','$rip','$now')";
    }     
    $rs=mysql_db_query($sql['db'],$qsql);
    $id=mysql_insert_id();
     
     
     
    if($type==0) { //?笆??mail_list
        $qsql="INSERT INTO  bbs_sml (sid,email) values('$id','$email')";
        $rs=mysql_db_query($sql['db'],$qsql);
     
    }
    if($type==0)  Send_the_doc_to_mail_list($aid,$id,$id);
    else           Send_the_doc_to_mail_list($aid,$sid,$id);     
    //incdocs($aid);
    if($type==0) { $sid=$rid=$id;}
    else         { $rid=$id;}
    echo "
          <script language=javascript>
          document.location='$PHP_SELF?proc=view&aid=$aid&sid=$sid&rid=$rid'
          </script>
         ";  
          
}
//======================================================================
function search_docs($aid,$skey) {
    $DROOT=getenv('DOCUMENT_ROOT');
    include("sql.php3");
    $db=mysql_connect($sql['host'], $sql['user'] , $sql['passwd']);  
    //$qsql="SELECT * from bbs_docs where sid='$id' and (banner like '$skey' or poster like '$skey' or body like '$skey') order by wdate DESC";
    if($aid) $qsql="SELECT * from bbs_docs where aid='$aid' and (banner like '$skey' or poster like '$skey' or body like '$skey') order by wdate DESC";
    else $qsql="SELECT * from bbs_docs where  (banner like '$skey' or poster like '$skey' or body like '$skey') order by wdate DESC";     
    $rs=mysql_db_query($sql['db'],$qsql);
        while($row=mysql_fetch_array($rs)) {
        $id=$row['id'];
            $banner=$row['banner'];
            $poster=$row['poster'];
            $views=$row['views'];
            $wdate=sdatetime($row['wdate']);
            $aid=$row['aid'];
            $sid=$row['sid'];
             
            echo "<tr bgcolor='#F0F0F0'>";
                echo "<td>";
                    echo "<a href=$PHP_SELF?proc=view&aid=$aid&sid=$sid&rid=$id>";
                    echo "&nbsp;&nbsp;<font color=#836FFF>$banner</font>";
                    echo "</a>";
                     
                echo "</td>";
                echo "<td>";
                    echo $poster;
                echo "</td>";
                echo "<td class='num'>";
                    echo "&nbsp;";
                echo "</td>";
                echo "<td class='num'>";
                    echo $views;
                echo "</td>";
                echo "<td class='num'>";
                    echo $wdate;
                echo "</td>";
             
            echo "</tr>";
    }
     
}
//======================================================================
function search() {
    global $PHP_SELF;
    global $key,$aid;
    if(!strlen($key)) {
    echo "
          <script language=javascript>
            history.back();
          </script>
         ";
    }
    echo "<TABLE width=85% border=0 cellPadding=0 cellSpacing=1 align=center class='tablefont'>";
    echo

[1] [2] [3] 下一页


 
免责声明:作品版权归所属媒体与作者所有!!本站刊载此文不代表同意其说法或描述,仅为提供更多信息。如果您认为我们侵犯了您的版权,请告知!本站立即删除。有异议请联系我们。
文章录入:烟灰缸    责任编辑:烟灰缸 
  • 上一篇文章:
  • 下一篇文章:
  • 网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    | 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 版权申明 | 网站公告 | 管理登录 |