Exemplo n.º 1
0
function CleanFiles($dir)
{
    //Borrar los ficheros temporales
    $t = time();
    $h = opendir($dir);
    while ($file = readdir($h)) {
        if (substr($file, 0, 3) == 'tmp' && substr($file, -4) == '.pdf') {
            $path = $dir . '/' . $file;
            if ($t - filemtime($path) > 3600) {
                @unlink($path);
            }
        }
    }
    closedir($h);
}
CleanFiles("evaluacion");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>INFORMES DE EVALUACION</title>
</head>

<body>
<p><img src="LOGO.jpg" width="100%" height="115" /></p>
<form action="procesaclaves.php" method="post" name="claves">
  <label for="textfield">Nombre:</label>
  <input name="nombre" type="text" id="nombre"  />
  <label for="label">Contraseña:</label>
  <input name="contra" type="password" id="contra"  />
Exemplo n.º 2
0
    $t = time();
    $h = opendir($dir);
    while ($file = readdir($h)) {
        if (substr($file, 0, 3) == 'tmp' && substr($file, -4) == '.pdf') {
            $path = $dir . '/' . $file;
            if ($t - filemtime($path) > 3600) {
                @unlink($path);
            }
        }
    }
    closedir($h);
}
CleanFiles("evaluacion1");
CleanFiles("evaluacion2");
CleanFiles("evaluacion3");
CleanFiles("evaluacionextra");
?>

<html>
<head>
<title>Evaluación inicial</title>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>

<body>
    <h1 align="center">Evaluación inicial</h1>
<form action="procesaClaves.php" method="post" name="claves">
  <label for="textfield">Nombre:</label>
  <input name="nombre" type="text" id="nombre"/>
  <label for="label">Contraseña:</label>
  <input name="contra" type="password" id="contra"  />