A wygląda to tak
<?php
function makelisting($querystring, $link, $guidestring, $cur_page, $properties_per_page, $sort)
{
if ($sort == "") {$sort = "id DESC";}
$querystring = $querystring." ORDER BY $sort";
$page_num = $cur_page + 1;
$properties_per_page = "98";
$total_num_page = ceil($num_rows/$properties_per_page);
include("includes/common.php");
if ($num_rows == "1") {Print "tylko 1 .<BR>";} else {Print "W bazie jest $num_rows <BR>";}
if ($total_num_page != 0)
{
Print "Strona $page_num z $total_num_page."; print "</center></h3><center>"; $prevpage = $cur_page-1;
$nextpage = $cur_page+1;
}
$properties_per_page = 98;
$limit_str = "LIMIT ". $cur_page * $properties_per_page .",$properties_per_page";
$query = "$querystring $limit_str";
$zm = '';
{
$zm.=$a_row['title'].',';
}
$katalog = "tumail";
$nazwa = $katalog.'/'."tytuly.txt";
$plik = fopen($nazwa, "w");
//$dane = $zm;
//fputs ($plik, $dane);
}
if ($total_num_page > 1)
{
print "<center><P><FORM name=pagejump>"; Print "<SELECT NAME=\"selectpage\" onChange=\"window.location.href=document.pagejump.selectpage.options[document.pagejump.sele
ctpage.selectedIndex].value\"> "; Print "<OPTION VALUE=\"./propview.php?$guidestring&cur_page\" SELECTED>Jump To Another Page "; for ($counter=0; $counter<=$total_num_page-1; $counter++)
{
$page_jump = $counter +1;
print "<OPTION VALUE=\"./propview.php?$guidestring&cur_page=$counter&sort=$sort\">Page $page_jump "; }
}
if ($total_num_page != 0)
{
$prevpage = $cur_page-1;
$nextpage = $cur_page+1;
if ($page_num != 1
){print "<a href=\"./propview.php?$guidestring&cur_page=$prevpage&sort=$sort\">Previous Page</a> ";} if ($page_num != $total_num_page){print " <a href=\"./propview.php?$guidestring&cur_page=$nextpage&sort=$sort\">Next Page</a> ";} }
}
?>