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 "
";
return;
}
//$banner=AddSlashes($banner);
//$body=AddSlashes($body);
$rip=getenv('REMOTE_ADDR');
$DROOT=getenv('DOCUMENT_ROOT');
include("sql.php3");
$db=mysql_connect($sql['host'], $sql['user'] , $sql['passwd']);
$now=date('Y')."-".date('m')."-".date('d')." ".date('H').":".date('i').":".date('s');
if($CHAR_GB==1) {
include("CCharset.php3");
$code=new CCharset;
$banner=$code->Gb_Big5($banner);
$body=$code->Gb_Big5($body);
$poster=$code->Gb_Big5($poster);
}
if($type==1) {
$qsql="INSERT INTO bbs_docs (aid,sid,banner,body,poster,email,pip,wdate)
values('$aid','$sid','$banner','$body','$poster','$email','$rip','$now')";
} else {
$qsql="INSERT INTO bbs_subj (aid,banner,body,poster,email,pip,wdate)
values('$aid','$banner','$body','$poster','$email','$rip','$now')";
}
$rs=mysql_db_query($sql['db'],$qsql);
$id=mysql_insert_id();
if($type==0) { //笆mail_list
$qsql="INSERT INTO bbs_sml (sid,email) values('$id','$email')";
$rs=mysql_db_query($sql['db'],$qsql);
}
if($type==0) Send_the_doc_to_mail_list($aid,$id,$id);
else Send_the_doc_to_mail_list($aid,$sid,$id);
//incdocs($aid);
if($type==0) { $sid=$rid=$id;}
else { $rid=$id;}
echo "
";
}
//======================================================================
function search_docs($aid,$skey) {
$DROOT=getenv('DOCUMENT_ROOT');
include("sql.php3");
$db=mysql_connect($sql['host'], $sql['user'] , $sql['passwd']);
//$qsql="SELECT * from bbs_docs where sid='$id' and (banner like '$skey' or poster like '$skey' or body like '$skey') order by wdate DESC";
if($aid) $qsql="SELECT * from bbs_docs where aid='$aid' and (banner like '$skey' or poster like '$skey' or body like '$skey') order by wdate DESC";
else $qsql="SELECT * from bbs_docs where (banner like '$skey' or poster like '$skey' or body like '$skey') order by wdate DESC";
$rs=mysql_db_query($sql['db'],$qsql);
while($row=mysql_fetch_array($rs)) {
$id=$row['id'];
$banner=$row['banner'];
$poster=$row['poster'];
$views=$row['views'];
$wdate=sdatetime($row['wdate']);
$aid=$row['aid'];
$sid=$row['sid'];
echo "
echo "
echo "";
echo " $banner";
echo "";
echo "
echo "
echo $poster;
echo "
echo "
echo " ";
echo "
echo "
echo $views;
echo "
echo "
echo $wdate;
echo "
echo "
}
}
//======================================================================
function search() {
global $PHP_SELF;
global $key,$aid;
if(!strlen($key)) {
echo "
";
}
echo "
$skey="%$key%";
$DROOT=getenv('DOCUMENT_ROOT');
include("sql.php3");
$db=mysql_connect($sql['host'], $sql['user'] , $sql['passwd']);
if($aid) $qsql="SELECT * from bbs_subj where aid='$aid' and (banner like '$skey' or poster like '$skey' or body like '$skey') order by wdate DESC";
else $qsql="SELECT * from bbs_subj where (banner like '$skey' or poster like '$skey' or body like '$skey') order by wdate DESC";
//echo $qsql;
$rs=mysql_db_query($sql['db'],$qsql);
echo "
"; echo "
echo" |
}
//======================================================================
if($proc=="post2") {
setcookie("c_poster",$poster,time()+ 31536000);
setcookie("c_email",$email,time()+ 31536000);
}
//if($proc!="do_sel" && $proc!="post2" && $proc!="colloff" && $proc!="collon") include("frame_top.php3");
switch($proc) {
case search:
search();
break;
case mail_list:
mail_list();
break;
case mail_friend:
mail_friend();
break;
case post2:
post2();
break;
case colloff:
cook_cooloff();
break;
case collon:
cook_coolon();
break;
case view;
view();
break;
default:
area();
break;
}
//if($proc!="do_sel" && $proc!="post2" && $proc!="colloff" && $proc!="collon") include("frame_bottom.php3");
?>
以上前五篇为一个页面

php把负数转为正整数的方法:1、使用abs()函数将负数转为正数,使用intval()函数对正数取整,转为正整数,语法“intval(abs($number))”;2、利用“~”位运算符将负数取反加一,语法“~$number + 1”。

在PHP中,可以利用implode()函数的第一个参数来设置没有分隔符,该函数的第一个参数用于规定数组元素之间放置的内容,默认是空字符串,也可将第一个参数设置为空,语法为“implode(数组)”或者“implode("",数组)”。

增加元素的方法:1、使用“array_unshift(数组,数组元素)”语句,在数组的开头添加元素;2、使用“array_push(数组,数组元素)”语句,在数组的末尾添加元素;3、用“array_pad(数组,数组长度+1,元素)”语句。

在php中,可以使用array_count_values()函数来统计数组里同一个值有几个,语法为“array_count_values($array)”;该函数会返回一个关联数组,其元素的键名是原数组的值,键值是该值在原数组中出现的次数。

开源软件的优点与弱点:解析开源模式的利与弊,需要具体代码示例在当今数字化信息时代,开源软件正逐渐成为软件开发的主流趋势。开源软件指的是其源代码可被公开查看、使用、修改和分发的软件。相比于传统的闭源软件,开源软件具有诸多优点,但同时也存在一些弱点。本文将从开源软件的优点和弱点两个方面展开讨论,同时结合具体代码示例,深入探究开源模式的利与弊。首先,让我们从开源软

有这样一个AI专属的社交平台,近日正在悄悄扩张。它名为“Chirper”,中文意为动物昆虫叫声的拟声词,官方翻译为“奇鸟”。网站域名在4月20日注册,上线不到一个月,平台中的AI就已经产生上亿条包含文字、图片、转评赞等社交行为的推文信息。——是的,支撑着这一社交平台运转的,无一例外全是AI。与此同时,平台对全体人类“禁言”,使其无法发言或进行任何社交行为,人们只能不断刷新首页,围观AI们的社交行为。那么,这个号称“禁止人类入内”的平台中真的只有AI吗?这些AI如何诞生?又如何进行争吵、互赞、甚至

PHP开发技术:打造一个网络问答社区随着互联网的快速发展和信息的爆炸式增长,网络问答社区逐渐成为人们获取知识和解决问题的主要方式。在这样的背景下,利用PHP开发技术来打造一个高效、稳定的网络问答社区成为了一个具有吸引力的项目。一.社区特点及需求分析在开始开发之前,我们首先要明确社区的特点和用户需求,以确保开发的方向和目标清晰明确。1.用户黏性高:一个好的问答

Java框架社区对个人开发者有重大影响,通过以下方式:职业发展:提升就业机会,专业化和认证,网络和指导关系提升技术技能:持续学习,了解新技术,解决复杂问题参与开源项目:贡献代码,分享知识,接受挑战


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Dreamweaver CS6
Visual web development tools

SublimeText3 Linux new version
SublimeText3 Linux latest version

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),
