Functioncook_cooloff () & #123; global & #36; PHP_SELF, & #36; aid, & #36; pgno; setcookie (OPEN_LIST, 0, time () + 31536000 ); header (Location: & #36; PHP_SELF? Aid & #36; aid & pgno & #36; pg 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 (the best combination with PHP) _ 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 (the best combination with PHP) _ db_query ($ SQL ['DB'], $ qsql );
$ Row = MySQL (the best combination with PHP) _ 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 = '$ View' where id =' $ rid '";
MySQL (the best combination with PHP) _ 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; // invalid variable
If (strlen ($ way2) $ mailtype = 1 ;//
$ DROOT = getenv ('document _ root ');
Include ("SQL. php3 ");
$ Db = MySQL (the best combination with PHP) _ connect ($ SQL ['host'], $ SQL ['user'], $ SQL ['passwd']);
If ($ mailtype = 0) {// invalid response
$ Qsql = "SELECT * from bbs_sml where sid = '$ sid' AND email = '$ email '";
$ Rs = MySQL (the best combination with PHP) _ db_query ($ SQL ['DB'], $ qsql );
If (MySQL (the best combination with PHP) _ num_rows ($ rs) = 0) {// near
$ Qsql = "insert into bbs_sml (sid, email) values ('$ sid', '$ email ')";
$ Rs = MySQL (the best combination with PHP) _ db_query ($ SQL ['DB'], $ qsql );
12 3 4 Next Page