aster";
$html_mail = "no";
?>
<HTML>
<HEAD>
<TITLE><?php echo $page_title; ?></TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" LINK="#000000">
<FONT FACE="Verdana" SIZE="-2">
<?
/* connect to the database */
mysql_pconnect("$host","$user","$password") or die("Can''t connect to the SQL-server");
mysql_select_db("$database");
/* action=view : retrieve data from the database and show it to the user */
if($action == "view") {
/* function for showing the data */
function search_it($name) {
/* some vars */
global $offset,$total,$lpp,$dir;
global $table,$html_mail,$admin_name,$admin_mail;
/* select the data to get out of the database */
$query = "SELECT name, email, job, comments FROM $table";
$result = mysql_query($query);
$total= mysql_numrows($result);
print "<CENTER><FONT FACE="Verdana" SIZE="-2"><A HREF="guestbook.php3?action=add" onMouseOver="window.status=''Add your name'';return true" onMouseOut="window.status='''';return true" TITLE="Add your name">加入留言</A></FONT></CENTER><br><br>";
if ($total== 0) {
print "<CENTER>此刻没人留言</CENTER><br><br>"; }
elseif ($total> 0) {
/* default */
$counter=0;
if ($dir=="") $dir="Next";
$lpp=5;
if ($offset==0) $offset=0;
if ($dir=="Next") {
if ($total > $lpp) {
$counter=$offset;
$offset =$lpp;
$num=$offset;
if ($num > $total) {
$num=$total; } }
else {
$num=$total; } }
elseif ($dir=="Previous") {
if ($total > $lpp) {
$offset-=$lpp;
if ($offset < 0) {
$offset=0; }
$counter=$offset-$lpp;
if ($counter < 0)
$counter=0;
$num=$counter $lpp; }
else {
$num=$total; } }
while ($counter < $num) {
$j=0;
$j=$counter 1;
/* now really grab the data */
$i1=mysql_result($result,$counter,"name");
$i2=mysql_result($result,$counter,"email");
$i3=mysql_result($result,$counter,"job");
$i4=mysql_result($result,$counter,"comments");
$i4 = stripslashes ("$i4");
/* print it in a nice layout */
print "<CENTER>n";
print "<TABLE WIDTH=400 BORDER=0 ALIGN=CENTER VALIGN=TOP><TR><TD><FONT FACE="Verdana" SIZE="-2">n";
print "<HR>n";
print "<BR><B>Name:</B> $i1n";
print "<BR><B>email:</B><A HREF="mailto:$i2" onMouseOver="window.status=''Email $i2'';return true" onMouseOut="window.status='''';return true" TITLE="Email $i2">$i2</A>n";
print "<BR><B>Job:</B> $i3n";
print "<BR><B>Comment:</B>n";
print "<BR>$i4n";
p |