Can ne1 help me the code showing the total page and the page wherein the the user is in in this script? eg. Page: 3/15
<?php $conf["items_per_page"] = 8; header("Pragma: no-cache"); echo "<?xml version=\"1.0\"?>";echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">"; echo "<html xmlns="http://www.w3.org/1999/xhtml">"; echo "<head>"; echo "<meta forua="false" http-equiv="Cache-Control" content="max-age=0" />"; echo "<meta forua="false" http-equiv="Cache-Control" content="must-revalidate" />"; echo "<meta name="keywords" content="wap news, messages, chatrooms, downloads, mp3, games, scandals, AMR, polytones, animations, wallpapers, themes, applications, videos ,tools , wap service, entertainment, wap search, useful linksers Link, Wapmaster, top downloads, free">"; echo "<meta name="description" content="100% Free Downloads">"; echo "<meta http-equiv="Content-type" content="application/vnd.wap.xhtml+xml" charset="utf-8" />"; echo "<title>Test</title>"; echo "<style type="text/css">";
include ('../../test.php');
if (!isset($page)) {$page = 0;} $total = 0;
if(!($dp = opendir("./"))) die ("Cannot open ./"); $file_array = array(); while ($file = readdir ($dp)) { if(substr($file,0,1) != '.' and $file != "index.php") { $file_array[] = $file; } } $file_count = count ($file_array); sort ($file_array);
echo "</style></head><body>"; echo "";
include("../../test.php"); echo ""; echo "";
if ($file_count > 0)
{
$first_record = $page * $conf["items_per_page"];
$last_record = $first_record + $conf["items_per_page"];
while (list($fileIndexValue, $file_name) = each ($file_array))
{
if (($fileIndexValue >= $first_record) AND ($fileIndexValue < $last_record))
{
echo "$file_name
";
echo "<a href="$file_name">Download (". round(filesize($file_name)/1024,1) . "kb)</a>
"; $total = $total + filesize($file_name); } }
{echo '';
echo '
';
include("../../test.php");
echo '
';
}
if (($file_count > 0) AND ($page != 0))
{
// previous button
$prev_page = $page -1;
echo "<a href="".$_SERVER["PHP_SELF"]."?page=$prev_page"><<Prev</a> ";
}
if (($file_count > 0) AND ($last_record < $file_count))
{
// next button
$next_page = $page + 1;
echo "<a href="".$_SERVER["PHP_SELF"]."?page=$next_page">Next>></a>";
}
echo "
$file_count ";
if ($file_count == 1)
{echo "File";}
else
{echo "Files";}
echo "";
echo '';
include("../../test.php");
echo "";
echo '';
echo "<a href="../../themes/index.php">Themes</a>";
echo "
<a href="../../index.php"><img alt="" src="../../../images/home.gif" />Home</a>";
}
closedir($dp);
echo "";
echo "";
echo "</body>";
echo "</xhtml>";
?>