J'aimerais savoir si c'est possible et comment faire pour lister le contenu d'un répertoire et pouvoir sélectionner un fichier X ensuite le récupérer dans un interface html...celle du <div id="main"> décrit plus bas....

Pour le moment je produit les fichiers avec

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
<?php
if (!isset($_POST['submit'])) {
header('Content-Type: text/html;charset=UTF-8');
?>
<!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>
   <title>No</title>
   <link href="../style/admstyle.css" rel="stylesheet" type="text/css" />
</head>
 
<body>
  <div id="main">
    <div id="caption">News</div>
	  <form name="admnews" action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" method="post">
        News:<br/>
        <input type="text" name="title" size="40"/><br/><br/>
        Contenu:<br/>
        <textarea name="newstext" rows="15" cols="67"></textarea><br/>
		Auteur:<br/>
		<input type="text" name="name" size="40"/><br/><br/>
        <center><input type="submit" name="submit" value="Publier" /></center>
     </form> 
<?php
$lines = file('note.txt');
// display file line by line
foreach($lines as $line_num => $line) {
    echo "".htmlspecialchars($line)."<br />\n";
}
?>
  </div>
</body>   
</html>
<?php } else {
   $newsTitel   = isset($_POST['title']) ? $_POST['title'] : 'Untitled';
   $submitDate  = date('Y-m-d');
   $submitName  = isset($_POST['name']) ? $_POST['name'] : 'No User';
   $newsContent = isset($_POST['newstext']) ? $_POST['newstext'] : 'No content';
 
   $filename = date('YmdHis');
   $f = fopen('../news/'.$filename.".txt","w+");         
   fwrite($f,$newsTitel."\n");
   fwrite($f,$submitDate."\n");
   fwrite($f,$submitName."\n");
   fwrite($f,$newsContent."\n");
   fclose($f);
 
   header('Location:../index.php');   
}
?>
Merci pour les infos