社区(php&&mysql)一

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

待续......

(0)

相关推荐

  • win10 下安装mysql服务器社区版本mysql 5.7.22 winx64的图文教程

    下载: http://dev.mysql.com/downloads/mysql/ 解压到C盘 添加环境变量path 添加环境变量 右击我的电脑->属性->高级系统设置->高级->环境变量-> 在系统变量中找到变量Path,点击编辑,在变量值最后面添加解压路径,路径要到bin文件夹下的路径,如: 以管理员权限运行cmd 安装MySQL服务 在cmd 命令窗口下 输入 mysqld install 初始化mysql数据库,这时会创建刚刚配置的data目录和一些数据库系统用的基本

  • 社区(php&&mysql)一

    function cook_cooloff(){     global $PHP_SELF,$aid,$pgno;     setcookie("OPEN_LIST",0,time()+ 31536000);     Header("Location:$PHP_SELF?aid=$aid&pgno=$pgno");     exit; } //==========================================================

  • 社区(php&&mysql)五

    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

  • 社区(php&&mysql)四

    echo "<br>";     echo "<TABLE width=85% border=0 cellPadding=0 cellSpacing=1 align=center bgcolor='#6CA6CD'>";       echo "<tr><td>";       echo "<TABLE width=100% cellPadding=1 cellSpacing=1 b

  • 社区(php&&mysql)三

    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($

  • 社区(php&&mysql)六

    //此为bbs.sql CREATE TABLE bbs_area (    id int(10) unsigned DEFAULT '0' NOT NULL auto_increment,    master varchar(150) NOT NULL,    banner varchar(150) NOT NULL,    body text NOT NULL,    email varchar(50),    login varchar(20),    passwd varchar(20)

  • 社区(php&&mysql)二

    function sdatetime($str){     $str=ereg_replace("-","/",$str);     $str=substr($str,5,strlen($str)-8);     return $str; } function reAnum($sid){ //羆莱絞计     $DROOT=getenv('DOCUMENT_ROOT');     include("sql.php3");     $db=mys

  • ubuntu kylin 14.10下多个mysql 5.7.14安装教程

    前文已述,因为需要测试mysql的主从配置方案,所以要安装多个mysql.这次是在ubuntu kylin 14.10上安装多个mysql 5.7.14. 系统环境:ubuntu kylin 14.10,64位系统 mysql版本:5.7.14社区版 mysql下载地址:http://dev.mysql.com/downloads/mysql/,选择 Linux - Generic,下载612.9M的mysql-5.7.14-linux-glibc2.5-x86_64.tar.gz mysql官

  • windows 10下mysql 5.7.21 winx64安装配置方法图文教程

    mysql 5.7.21 winx64安装配置方法: 下载社区版mysql,下载地址(下载前需要注册oracle帐号) 解压缩 配置环境变量 在系统变量path上加上:C:\mysql-5.7.21-winx64\bin(指向mysql 的bin路径) 初始化 用管理员身份打开cmd,输入命令(初始化的时候在安装目录下创建了data目录,否则会报路径不存在): mysqld --initialize --user=mysql --console 初始化的时候会生成root的临时密码,需要记住用户

  • mysql installer web community 5.7.21.0.msi安装图文教程

    本文实例为大家分享了Android九宫格图片展示的具体代码,供大家参考,具体内容如下 我是从 官网 上面下载的社区版MySQL(版本为mysql-installer-web-community-5.7.21.0) 下载好之后,双击mysql-installer-web-community-5.7.21.0.msi,进入安装步骤: 1.选中" Iaccept the license terms"单击Next. 2.选择安装类型,本人这里选择"Server only",

随机推荐