Community (Php&&mysql) a

Source: Internet
Author: User
Tags exit header include mail mysql setcookie
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 $way 1, $way 2;

if (Check_mail ($email)) {
$mailtype = 0; 璹
if (strlen ($way 2)) $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) {//Pro ⊿
$qsql = "INSERT into BBS_SML (sid,email) VALUES (' $sid ', ' $email ')";
$rs =mysql_db_query ($sql [' db '], $qsql);
} else {
echo "
<script language=javascript>
Alert ('  竒 ,ぃ hui  cunning  ');
</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) {// worm
$qsql = "DELETE from BBS_SML where sid= ' $sid ' and email= ' $email '";
$rs =mysql_db_query ($sql [' db '], $qsql);
} else {
echo "
<script language=javascript>
Alert (' ﹟ゼ worm ず! ');
</script>
";

}

}

} else {
echo "
<script language=javascript>
Alert (' E-mailα kui 粇 ');
</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. " ㄓ 璹 is ゅ Beecher ";
$message = ": $poster \ n";
$message. = "がくしゅくしゅしていて 肈: $banner \ n";
$message. = "がくしゅくしゅしていて Beecher ず 甧: $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;
}
盚 hates Agent 
$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  inbound 秈 ゅ Beecher", $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. " ざ remnant ゅ Beecher ";
$message = " 狟 ね: $c _posterざ remnant  this test Beecher";
$message. = "がくしゅくしゅしていて 肈: $banner \ n";
$message. = "がくしゅくしゅしていて Beecher ず 甧: $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α kui 粇 ');
</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>
";
}

Cond......

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.