rint "</FONT></TD></TR></TABLE>n";
print "</CENTER>n";
$counter ;
}
}
mysql_close();
}
/* execute the function */
search_it($name);
/* See if we need to put on the NEXT or PREVIOUS buttons */
if ($total > $lpp) {
echo("<form action="$PHP_SCRIPT" method="POST">n");
/* See if we need a PREVIOUS button */
if ($offset > $lpp) {
echo("<input type="submit" value="Previous" name=dir>n"); }
/* See if we need a NEXT button */
if ($offset < $total) {
echo("<input type="submit" value="Next" name=dir>n"); }
echo("<input type=hidden name="offset" value="$offset">n");
echo("<input type=hidden name="name" value="$name">n");
echo("</form>");
}
}
/* action=add : show a form where the user can enter data to add to the database */
elseif($action == "add") { ?>
<TABLE WIDTH="460" ALIGN="CENTER" VALIGN="TOP">
<TH COLSPAN="2"><P>请您填写留言</TH>
<FORM NAME="guestbook" ACTION="guestbook.php3?action=send" METHOD="POST">
<TR>
<TD ALIGN="RIGHT" VALIGN="TOP">
您的大名:</TD>
<TD><INPUT TYPE=text NAME=name></TD>
</TR>
<TR>
<TD ALIGN="RIGHT" VALIGN="TOP">
您的E-mail:</TD>
<TD>
<INPUT TYPE=text NAME=email></TD>
</TR>
<TR>
<TD ALIGN="RIGHT" VALIGN="TOP">
您的工作:</TD>
<TD>
<INPUT TYPE=text NAME=job></TD>
</TR>
<TR>
<TD ALIGN="RIGHT" VALIGN="TOP">
您的留言:</TD>
<TD>
<TEXTAREA NAME=comments COLS=40 ROWS=6></TEXTAREA>
<P>
<INPUT TYPE=submit VALUE=Submit> <INPUT TYPE=Reset VALUE=Reset>
<A ALIGN="RIGHT" HREF="guestbook.php3?action=view" onMouseOver="window.status=''Read all comments first'';return true" onMouseOut="window.status='''';return true" TITLE="Read all comments first"><FONT SIZE="-2">先观看所有的留言</FONT></A>
</TD>
</TR>
</FORM>
</TABLE>
</CENTER>
<?
}
/* action=send : add the data from the user into the database */
elseif($action == "send") {
/* check if a HTML-mail should be send or a plain/text mail */
if($html_mail == "yes") {
mail("$admin_name <$admin_mail>","PHP3 Guestbook Addition","<HTML><BODY><FONT FACE="Century Gothic"><TABLE BORDER="0" WIDTH="100%" CELLSPACING="4"><TR>$name ($email) schreef het volgende bericht in het gastenboek :</TR><TR>< |