All pastes #444819 Raw Edit

Kud

public php v1 · immutable
·published 2007-04-17 15:11 UTC
rendered paste body
<?phpfunction taille($fichier)	{	global $size_unit;	$taille=filesize($fichier);	if ($taille >= 1073741824) 		{$taille = round($taille / 1073741824 * 100) / 100 . " Go";}	elseif ($taille >= 1048576) 		{$taille = round($taille / 1048576 * 100) / 100 . " Mo";}	elseif ($taille >= 1024) 		{$taille = round($taille / 1024 * 100) / 100 . " Ko";}	else 		{$taille = $taille . " o";} 	if($taille==0) {$taille="-";}		return $taille;	}/*if isset($_POST['liste'])	{	unlink $_POST['liste'];	}*/?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">	<head>		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15" />		<link rel="stylesheet" type="text/css" href="style.css" media="screen" />		<title>Formulaire - Envoi de fichier</title>		</head>	<body>		<h1>Liste des fichiers</h1>		<form method="post" action="liste.php">			<table>				<tr>					<td>Fichier</td>					<td>Type</td>					<td>Taille</td>					<td>Date de modification</td>					<td>Supprimer</td>				</tr><?php$folder = "files/";$type = substr($Fichier,-3);$dossier = opendir($folder);while ($Fichier = readdir($dossier))	{	if ($Fichier != "." && $Fichier != "..")		{		//$nomFichier = $folder."/".$Fichier;		$nomFichier = $Fichier;		$type = substr($Fichier,-3);		echo '<tr><td><a href="' . $folder . $Fichier . '">' . $nomFichier . '</a></td><td>' . $type  . '</td><td>' . taille('files/' . $Fichier) . '</td><td>' . date("d/m/y H:i:s", filemtime('files/' . $Fichier)) . '</td><td><input type="checkbox" name="liste[id]" /></td></tr>';		}	}closedir($dossier);?>			</table>		<p><input type="submit" name="supprimer" value="Supprimer" /></p>		</form>		<p><a href="./formulaire.php">Envoyer un nouveau fichier</a></p>	</body></html>