您的位置:首页网页设计PHP实例 → 社区php&&mysql一

社区php&&mysql一

时间:2004/11/7 3:27:00来源:本站整理作者:蓝点我要评论(0)

function cook_cooloff(){
    global $PHP_SELF,$aid,$pgno;
    setcookie("OPEN_LIST",0,time()+ 31536000);
    Header("Location:$PHP_SELF?aid=$aid&pgno=$pgno");
    exit;
}
//===============================================================
function cook_coolon(){
    global $PHP_SELF,$aid,$pgno;
    setcookie("OPEN_LIST",1,time()+ 31536000);
    Header("Location:$PHP_SELF?aid=$aid&pgno=$pgno");
    exit;
}
function check_mail($semail)
{
    $str=strchr($semail,'@');   
    if ($str=="") return false;
    $str=strchr($semail,".");
    if ($str=="") return false;
    return true;
}
//================================================================
function addhitviews($sid,$rid) {
    $DROOT=getenv('DOCUMENT_ROOT');
    include("sql.php3");
    $db=mysql_connect($sql['host'], $sql['user'] , $sql['passwd']);  
    if($sid==$rid)     $qsql="SELECT * from bbs_subj where id='$rid'";
    else $qsql="SELECT * from bbs_docs where id='$rid'";
    $rs=mysql_db_query($sql['db'],$qsql);
    $row=mysql_fetch_array($rs);
    $views=$row['views'];
    $views++;
    if($sid==$rid)     $qsql="UPDATE bbs_subj SET views='$views' where id='$rid'";
    else $qsql="UPDATE bbs_docs SET views='$views' where id='$rid'";
     
    mysql_db_query($sql['db'],$qsql);
}

//===============================================================
function mail_list(){
    global $PHP_SELF,$HTTP_HOST,$email;
    global $aid,$sid,$rid;
    global $way1,$way2;
     
    if(check_mail($email)) {
    $mailtype=0; //璹綷
    if(strlen($way2)) $mailtype=1;//

    $DROOT=getenv('DOCUMENT_ROOT');
    include("sql.php3");
    $db=mysql_connect($sql['host'], $sql['user'] , $sql['passwd']);  
    if($mailtype==0) { //璹綷
        $qsql="SELECT * from bbs_sml where sid='$sid' AND email='$email'";
        $rs=mysql_db_query($sql['db'],$qsql);
        if(mysql_num_rows($rs)==0) { //临⊿
          $qsql="INSERT INTO  bbs_sml (sid,email) values('$sid','$email')";
          $rs=mysql_db_query($sql['db'],$qsql);
        } else {
          echo "
          <script language=javascript>
          alert('竒,ぃ惠狡');
          </script>
         ";     
        }
    } else { //璹綷
        $qsql="SELECT * from bbs_sml where sid='$sid' AND email='$email'";
        $rs=mysql_db_query($sql['db'],$qsql);
        if(mysql_num_rows($rs) > 0) { //虫
          $qsql="DELETE FROM  bbs_sml where sid='$sid' AND email='$email'";
          $rs=mysql_db_query($sql['db'],$qsql);
        } else {
          echo "
          <script language=javascript>
            alert('﹟ゼ虫ず!');
          </script>
         ";

        }

    }

    } else {
        echo "
          <script language=javascript>
              alert('E-mailΑ岿粇');
          </script>
         ";  
    }
    echo "
          <script language=javascript>
          document.location='$PHP_SELF?proc=view&aid=$aid&sid=$sid&rid=$rid'
          </script>
         ";  
}

//===============================================================
function Send_the_doc_to_mail_list($aid,$sid,$rid){
    global $PHP_SELF,$HTTP_HOST;
    $DROOT=getenv('DOCUMENT_ROOT');
    include("sql.php3");
    $db=mysql_connect($sql['host'], $sql['user'] , $sql['passwd']);  
    if($sid==$rid)     $qsql="SELECT * from bbs_subj where id='$sid'";
    else $qsql="SELECT * from bbs_docs where id='$rid'";
         
    $rs=mysql_db_query($sql['db'],$qsql);
    $row=mysql_fetch_array($rs);
    $poster=$row['poster'];
    $banner=$row['banner'];
    $body=$row['body'];

    $subj=$c_poster."ㄓ璹綷ゅ彻";
    $message=":$poster\n";
    $message.="ゅ彻夹肈:$banner\n";
    $message.="ゅ彻ず甧:$body\n";
    $message.="\nㄤ闽ゅ彻叫 http://$HTTP_HOST$PHP_SELF?proc=view&aid=$aid&sid=$sid&rid=$rid\n";
    $message.="<<舧>>\n";
    $mailfrom="From:Magic Jerry";


    $qsql="SELECT * from bbs_sml where sid='$sid'";
    $rs=mysql_db_query($sql['db'],$qsql);
    while($row=mysql_fetch_array($rs)) { //mail_list
        $email=$row['email'];
        mail($email,$subj,$message,$mailfrom);
        echo $email;
    }
    //盚倒恨瞶
    $qsql="SELECT * from bbs_area where id='$aid'";
    $rs=mysql_db_query($sql['db'],$qsql);
    $row=mysql_fetch_array($rs);
    $email=$row['email'];
    $banner=$row['banner'];

    mail($email,"$banner 穝秈ゅ彻",$message,$mailfrom);


}
//===============================================================
function mail_friend(){
    global $PHP_SELF,$HTTP_HOST,$c_email,$c_poster,$frmail;
    global $aid,$sid,$rid;
    if(check_mail($frmail)) {
    $DROOT=getenv('DOCUMENT_ROOT');
    include("sql.php3");
    $db=mysql_connect($sql['host'], $sql['user'] , $sql['passwd']);
    if($sid==$rid) {  
        $qsql="SELECT * from bbs_subj where id='$rid' ";
    } else {
        $qsql="SELECT * from bbs_docs where id='$rid' ";
    }
    $rs=mysql_db_query($sql['db'],$qsql);
    $row=mysql_fetch_array($rs);
     
    $banner=$row['banner'];
    $body=$row['body'];
     
    $subj=$c_poster."ざ残ゅ彻";
    $message="狟ね: $c_poster ざ残硂ゅ彻\n";
    $message.="ゅ彻夹肈:$banner\n";
    $message.="ゅ彻ず甧:$body\n";
    $message.="\nㄤ闽ゅ彻叫 http://$HTTP_HOST$PHP_SELF?proc=view&sid=$sid&aid=$aid&rid=$rid\n";
    $message.="<<舧>>\n";
    $mailfrom="From:".$c_email;
     
    mail($frmail,$subj,$message,$mailfrom);
    }else {
        echo "
          <script language=javascript>
              alert('E-mailΑ岿粇');
          </script>
         ";  
    }
    //echo "rid=$rid a=$aid s=$sid p=$pgno";
     
    echo "
          <script language=javascript>
          document.location='$PHP_SELF?proc=view&aid=$aid&sid=$sid&rid=$rid'
          </script>
         ";  
}

待续...... 

相关阅读 Windows错误代码大全 Windows错误代码查询激活windows有什么用Mac QQ和Windows QQ聊天记录怎么合并 Mac QQ和Windows QQ聊天记录Windows 10自动更新怎么关闭 如何关闭Windows 10自动更新windows 10 rs4快速预览版17017下载错误问题Win10秋季创意者更新16291更新了什么 win10 16291更新内容windows10秋季创意者更新时间 windows10秋季创意者更新内容kb3150513补丁更新了什么 Windows 10补丁kb3150513是什么

文章评论
发表评论

热门文章 没有查询到任何记录。

最新文章 我的php文件怎么打开_php运算符怎么写 php 如何生成静态页面的函数PHP生成图片缩略图PHP session常见问题集锦及解决办法PHP实现同步远程Mysql

人气排行 DEDE在文章列表文章没有缩略图的不显示图片php+mysq修改用户密码我的php文件怎么打开_如何打开php文件的办法FCKeditor的配置和使用方法使用dedecms建站教程PHP+Ajax实现分页技术图片存储与浏览一例Linux+Apache+PHP+MySQLPHP生成图片缩略图