Location: PHPKode > scripts > ER Manager > ermanager/files/index.php
//get vars from do_upload.php
$called = 1;
include 'do_upload.php';
<TITLE> <?PHP print "$ntitle"; ?> </TITLE>

<div align="center">
Current Hosted Files:


//give option to upload a file
print "<table border=\"0\">";
print "<tr><td bgcolor=\"#B4B4B4\" width=\"180\" height=\"30\">";
print "<div align=\"center\"><a href=\"$scripturl"."show_upload.php?folder=$_GET[folder]\"><b><font face=\"Arial\" size=\"2\" color=\"#000000\">Click Here to upload a file.</font></b></a></div>";
print "</td></tr>";
print "</table><p>";


<TABLE border="0">

//set counter to 0
$tfiles = 0;

//open directory for reading files
$dh = opendir( $ufolder ) or die("Could not open directory");

//read files
while ( ! ( ( $file = readdir( $dh ) ) === false ) ) {
	//make sure file isn't in the don't read list
	if ( is_file( "$ufolder/$file" ) and (!in_array($file,$not_include)) )
		//add 1 to counter
		//print through all files add each to the table
		print " ";
		print "<TR>";
		print "<TD align=\"right\" bgcolor=\"#B4B4B4\">($tfiles)</TD>";
		print "<TD bgcolor=\"#B4B4B4\">";
		print "&nbsp;<a href=\"$url$file\" target=\"_blank\"><font face=\"arial\" color=\"#000000\" size=\"2\">$file</font></A>&nbsp;<BR>\n";
		print "</TD>";
		print "<TD bgcolor=\"#B4B4B4\">";
		$size = "".filesize ("$ufolder$file")."";
		$size = "".round(($size/1024), 2)."";
		print "<font face=\"arial\" color=\"#000000\" size=\"2\">&nbsp;$size KB&nbsp;</font>";
		print "</TD>";
echo "<td bgcolor=\"#B4B4B4\"><a href=do_delete.php?folder=$folder&file=$file><font face=\"arial\" color=\"#000000\" size=\"2\">delete file</font></a></td>"; // by paolo
		print "</TR>";
print "</table>";
print "<P>";
print "<table border=\"0\">";
print "<tr><td>";
print "Total files: $tfiles";
print "<p><a href=$ermanurl>ER Manager</a>";
print "</td></tr>";
print "</table>";
//close directory
closedir( $dh );

print "</div>";
Return current item: ER Manager