Submit "; } if (!isset($show)) $show=0; { $result1 = mysql_query("select Count(*) as total from $userstable") or die(mysql_error()); $row=mysql_fetch_Array($result1); $total=$row[total]; } if ($show < $total){ $query = "select * from $userstable order by id desc limit $show, $limit"; $result = mysql_query($query); $number = mysql_numrows($result); } elseif ($show = all){ $query = "select * from $userstable order by id desc"; $result = mysql_query($query); $number = mysql_numrows($result); } $i = 0; if ($number == 0){ print "
There are no entries at present.
\n"; } elseif ($number > 0) { print "

$total_entries: $total

\n"; print "\n\n \n \n\n
 Add an entry  Search 
\n"; while ($i < $number){ $row = mysql_fetch_array($result); $name = stripslashes($row[name]); $email = $row[email]; if ($email==""){ $mailtoname="$name"; }else{ $mailtoname="$name"; } $phone = $row[phone]; $location = $row[location]; $buysell = $row[buysell]; $type = $row[type]; $addressa = stripslashes(nl2br($row[addressa])); $addressb = stripslashes(nl2br($row[addressb])); if ($addressa=="" and $addressb==""){ $addressa="address not supplied"; } $detail = stripslashes(nl2br($row[detail])); $date = $row[date]; if (($i/2)==floor($i/2)){ $bgc="#eeeeee"; }else{ $bgc="#f8f8f8"; } print "
\n"; print "\n"; print "\n \n \n \n\n"; print "\n \n\n"; print "
$date
$buysell
$type
$mailtoname
$phone
$addressa
$addressb
$location
$detail
\n
\n"; $i++; } } include ("pages.inc.php3"); //if($show < 1){ include ("form.inc.php3"); //} include("$footer"); // Adapted from MyGuestbook, http://www.html-design.com/MyGuestbook/ ?>