Home > Article > Backend Development > Challenge the best guestbook source code (5)_PHP tutorial
表中没有数据!
';}
else
{
$next_index=$initial_record+$number_records_to_display;
if ($next_index>$number_of_records)
$next_index=$number_of_records;
$prev_index=$initial_record-$number_records_to_display;
if ($prev_index<0)
{
$prev_index=0;
}
}
echo "
"; if ($initial_record!=0) { $t1="initial_record=$prev_index"; $sort="sort_field=$sort_field"; $asc="sort_direction=$sort_direction"; echo ""; echo "<<前 $number_records_to_display 条留言"; } else { echo "|前面没有留言了"; } echo " | "; $t2=$initial_record+1; echo "This page Showing comments from $t2 to $next_index out of $number_of_records Leave a message"; echo " | "; if ($next_index!=$number_of_records) { $t1="initial_record=$next_index"; $sort="sort_field=$sort_field"; $asc="sort_direction=$sort_direction"; echo " "; echo "Last $number_records_to_display messages>>"; } else { echo "There is no message behind|"; } echo " |
";
?>
< ?php
echo "
"; echo "Go to page"; if (($number_of_records % $number_records_to_display)==0) { $number_of_pages=$number_of_records / $number_records_to_display; } else { $number_of_pages=($number_of_records-($number_of_records % $number_records_to_display))/$number_records_to_display+1; } $sort="sort_field=$sort_field" ; $asc="sort_direction=$sort_direction"; for ($ii=1;$ii<=$number_of_pages;$ii++) { $yeshu=($ii-1)*$number_records_to_display; $t1="initial_record=$yeshu "; if ($initial_record!=$yeshu) > echo ""; echo "[ $ii ]"; } else echo "[ $ii ]"; } echo "Pages of $number_of_pages pages"; echo " |
";
?>