<?
$p=10; //files to be displyaed per page
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
header("Content-type: text/vnd.wap.wml;");
echo '<?xml version="1.0"?>';
print '<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">'.
'<wml>
<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>';
echo "<card id=\"C1\" title=\"UPLOAD FILES\"><p><small>UPLOAD YOUR FILES HERE !</small><br/>------------<br/>";
echo "<small>";
$xfile = @file("uploads");
if ($npage == "")$npage = "1";
$countfile= count($xfile);
$second = ($p * $npage);
$first = ($p * ($npage-1));
$npages =(int) ceil($countfile / $p);
if ($npage <= $npages and $npage>1) $gline_rew = "<a href=\"$PHP_SELF?npage=".($npage-1)."\">Back</a>";
if ($npages > 1 and $npage<$npages) $gline_next = "<a href=\"$PHP_SELF?npage=".($npage+1)."\">Next</a> ";
$xfile = array_reverse($xfile);
for ($i = $first; $i <= $second-1; $i++)
  {

   $udata = explode("&&",$xfile[$i]);

   print ($i+1).". <a href=\"./upload/".htmlspecialchars($udata[1])."\">".htmlspecialchars($udata[1])."</a> &#187; (".$udata[2].") ".$udata[3]."<br/>";
}
echo "</small>-------------";
print "<small><br/>".$gline_rew."| ".$gline_next."<br/></small>";
print "<small>UPLODED FILES: $countfile </small><br/>";
print "<small>PAGE $npage OF $npages</small><br/>";
if($npages>2)print "<small>JUMP TP PAGE:</small><input emptyok=\"true\" name=\"q\" format=\"*N\" size=\"3\" value=\"\" /><a href=\"".$_SERVER["PHP_SELF"]."?npage=$(q)\">[Go]</a><br/>";
print "<small>&#187;<a href=\"./upload.php\">UPLOAD FILES</a></small>
<br/><small>GOTO: <b>UPLOAD.2-WAP.NET</b> FOR UPLOAD YOUR FILES FROM PC !<br/>&#171;<a href=\"../index.php\">BACK</a></small><br/>&#169; 2-WAP.NET
</p></card></wml>";

?>