Can sum1 make this script to work. cant figure out the problem. Help will be much appreciated..
CODE$conf["items_per_page"] = 8; header("Content-type: text/vnd.wap.wml"); header("Cache-Control: no-store, no-cache, must-revalidate"); print ""; echo "";
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); ?>
include("../../setting1.php"); echo " "; include("../../setting2.php"); 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 "Download (". round(filesize($file_name)/1024,1) . "kb)
"; $total = $total + filesize($file_name); } }
{echo '
'; echo '----- '; include("../../setting3.php"); echo ' '; } if (($file_count > 0) AND ($page != 0)) { // previous button $prev_page = $page -1; echo "
<<Prev "; } if (($file_count > 0) AND ($last_record < $file_count))
{ // next button $next_page = $page + 1; echo "Next>> "; } echo "$file_count "; if ($file_count == 1) {echo "File";} else {echo "Files";} echo " ";
if ($page == "")$page = "1"; $pages =(int) ceil($file_count/ $conf); echo "Page $page/$pages "; echo "----- "; echo "Ringtones"; echo " Home"; } closedir($dp); ?>