-------------------------------论坛--------------------------
数据表
create table guest(id int not null auto_increment,primary key(id),title varchar(50),email varchar(30),homepage varchar(30),name varchar(30),text text,relay int,r_time date)
create table relay(id int not null auto_increment,primary key(id),title int,email varchar(30),name varchar(30),text text)
-------------------------index.php--------------------------
$db =mysql_connect("localhost", "****","****");
mysql_select_db("****",$db);
@$result = mysql_query("SELECT * FROM Guest order by ID desc",$db);
$i=0;
while($myrow = mysql_fetch_row($result)) {
$guestbook[$i][0] = $myrow[0];
$guestbook[$i][1] = $myrow[1];
$guestbook[$i][2] = $myrow[2];
$guestbook[$i][3] = $myrow[4];
$guestbook[$i][4]=$myrow[6];
$guestbook[$i][5]=$myrow[7];
$i++;
} //读入组
mysql_close($db) ;
echo "----------------------------共[";
if ($q!="") {
$page = $q;
} else {
$page = 0;
}
$i=count($guestbook);
$msgnum=20; // 每页20笔
$start = $page * $msgnum;
$end = $start + $msgnum;
if ($end > $i) $end=$i;
$totalpage=$i/$msgnum;
for ($i=0; $i<$totalpage; $i++) {
if ($i!=$page) {
echo "
$i< ;/a>";
} else {
echo " $i";
}
}
echo "]页----------------------------
"; printf("追加主题
");
echo "
";
echo "";
echo "";echo "主题 | ";
echo "电子邮件 | ";
echo "呢称 | ";
echo "回复 | ";
echo "最終回复時間间 | ";
echo "
";
for ($i=$start; $i<$end; $i++) {
$id=$guestbook[$i][0];
echo "";echo ""; echo "";echo $guestbook[$i][1]; echo ""; echo " | ";
echo ""; echo ""; echo $guestbook[$i][2];echo "";echo " | ";
echo ""; エコー $guestbook[$i][3]; echo " | ";
echo ""; エコー $guestbook[$i][4]; echo " | ";
echo ""; エコー $guestbook[$i][5]; echo " | ";
エコー "
";
}
echo "
";
エコー「
」;
printf("
追加主题");
?>
------------------------------444.php-------------- ----------------
$db =mysql_connect("localhost", "****","****");
mysql_select_db("****",$db);
@$result = mysql_query("SELECT * FROM guest where id='$id'",$db);
echo "
";
$myrow = mysql_fetch_row($result);
echo "";echo "主题:";エコー $myrow[1]; echo " | "; echo "
";
$msg=base64_decode($myrow[5]);
$msg = ereg_replace(" "," ",$msg); //空格处理
$msg=nl2br($msg); // 换行处理
if ($myrow[3]!=""){$myrow[3]="$myrow[3] else
{$myrow[3]="我还没在网上安家";}
echo ""; echo "
"; echo $msg;echo " | ";echo "
";
エコー "
"; echo "主页:";エコー $myrow[3]; echo " |
";
echo "";echo ""; echo "回帰列表"; echo " | "; echo "
";
$num=$myrow[6];
@$result1 = mysql_query("SELECT * FROMリレー where title='$id' order by id desc",$db);
$i=0;
while($myrow1 = mysql_fetch_row($result1)) {
$guestbook[$i][0] = $myrow1[1];
$guestbook[$i][1] = $myrow1[2];
$guestbook[$i][2] = $myrow1[3];
$guestbook[$i][3]=$myrow1[4];
$i++;
}
mysql_close($db);
if ($q!="") {
$page = $q;
} else {
$page = 0;
}
$i=count($guestbook);
$msgnum=5; // 每页5笔
$start = $page * $msgnum;
$end = $start + $msgnum;
if ($end > $i) $end=$i;
$totalpage=$i/$msgnum;
for ($i=$start; $i $t=$guestbook[$i][0];
echo "";echo ""; エコー「Re:」;エコー $myrow[1]; echo " | "; echo "
";
エコー ""; echo ""; エコー $guestbook[$i][2]; echo " | "; echo "
";
エコー ""; echo "电子邮件:"; echo ""; echo $guestbook[$i][1];echo "";echo " | "; echo "
";
$msg=base64_decode($guestbook[$i][3]);
$msg = ereg_replace(" "," ",$msg);
$msg=nl2br($msg);
エコー「」; echo ""; $msg をエコー; echo " | "; echo "
";
}
echo "
"; echo "
"; echo "
"; echo "----------------------------共[";
for ($i=0; $i<$totalpage; $i++) {
if ($i!=$page) {
echo "
$私";
} else {
echo $i;
}
} echo "]页---------------------------------"; echo "
";
echo "
回复";echo "
";
echo "
浏览主题";
?>
--------------------------------333.php-------------- ---------------
if (!$t){
if ($text==""&$email==""&$name==""){echo "*必須";echo "< ;a href=333.php?t=$title&name=$name&email=$email&text=$text&num=$num>返されます"; }
else { if (eregi("^[_.0-9a-z-]+@([0-9a-z][0-9a-z-]+.)+[a-z]{2,3}$",$email)){
$text =base64_encode($text); //检验邮件地合法かどうか
$db =mysql_connect("localhost", "****","****");
$time=date("y-m-d");
mysql_select_db("****",$db);
$sql="リレー値に挿入('','$title','$email','$) name','$text')";
$result = mysql_query($sql);
$num=$num+1;
$sql="ゲストセットリレーの更新='$num',r_time='$time ' where id='$title'";
$result=mysql_query($sql);
mysql_close();
echo "
";
}
else { echo "邮件地址無效"; echo "
返";}
} }
else
{ ?>
}
?>
;
-------------------------------------www.php----- --------------------
if ($title!=""&$email!= ""&$name!="") {
if (eregi("^[_.0-9a-z-]+@([0-9a-z][0-9a-z-]+.)+ [a-z]{2,3}$",$email)){
$text =base64_encode($text); "****");
$time=date("y-m-d");
mysql_select_db("****",$db) ;
$sql="ゲスト値に挿入('','$title','$email','$ホームページ','$name','$text','','$time')";
$result = mysql_query($sql);mysql_close();
echo "
";
}
else
{echo "無効な電子メールアドレス"; lt; Return";}
//mysql_close($db)
//printf("メッセージ成功
ここをクリックして戻る ");
?>
< ;/HEAD>
-------------- ---- -------------111.php--------------------------