function Cook_cooloff(){
global $PHP_SELF,$aid,$pgno;
setcookie("OPEN_LIST",0,time() 31536000);
Header("Location:$PHP_SELF?aid=$aid&pgno=$pgno");
終了します。
}
//======================================== ======================
function Cook_coolon(){
global $PHP_SELF,$aid,$pgno;
setcookie("OPEN_LIST",1,time() 31536000);
Header("Location:$PHP_SELF?aid=$aid&pgno=$pgno");
終了します。
}
function check_mail($semail)
{
$str=strchr($semail,'@');
if ($str=="") は false を返します。
$str=strchr($semail,".");
if ($str=="") は false を返します。
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;
グローバル $aid,$sid,$rid;
グローバル $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) names('$sid','$email')";
$rs=mysql_db_query($sql['db'],$qsql);
} else {
echo "
」;
}
} 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 "
」;
}
}
} else {
echo "
";
}
echo "
";
}
//echo "rid=$rid a=$aid s=$sid p=$pgno";
echo "
";
}
待续......