1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
| <?php
require_once "connect.php";
session_start();
$_SESSION['demandeur'] = $_POST["demandeur"];
$_SESSION['date'] = $_POST["date"];
?>
<!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" xml:lang="fr">
<head><title>Reprographie</title></head>
<body>
<form method="post" enctype="multipart/form-data" action="depot_upload.php">
<?php
$a=$_POST["date"];
$b=$_POST["demandeur"];
$c=$_POST["classe"];
$d=$_POST["nbr"];
$e=$_POST["choix1"];
$f=$_POST["choix5"];
$g=$_POST["choix2"];
$h=$_POST["agrafe"];
mysql_query("INSERT INTO demande VALUES ('$b','$a','$c','$d','$e','$f','$g','$h')");
mysql_close($db);
$name=$_SESSION['demandeur'].$_SESSION['date'].".txt";
$content_dir = 'upload/';
$tmp_file = $_name['fichier']['tmp_name'];
$file = fopen("$name", "w"); // ouvre le fichier en écriture
fwrite($file, $a); // ecrit l'e-mail dans le fichier
fwrite($file, "");
fwrite($file, $b);
fwrite($file, "");
fwrite($file, $c);
fwrite($file, "");
fwrite($file, $d);
fwrite($file, "");
fwrite($file, $e);
fwrite($file, "");
fwrite($file, $f);
fwrite($file, "");
fwrite($file, $g);
fwrite($file, "");
fwrite($file, $h);
fclose($file); // ferme le fichier
move_uploaded_file($name, $content_dir);
?>
<p>
<!-- taille en octet -->
<input type="hidden" name="MAX_FILE_SIZE" value="100000000">
<input type="file" name="fichier" size="30">
<input type="submit" name="upload" value="Telecharger">
</p>
</form>
</body>
</html> |
Partager