<!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"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Liste des films</title>
<link rel="stylesheet" type="text/css" href="affichage.css" />
</head>

<body>
<h1>Liste des films</h1>

<table>
  <caption>Films</caption>
  <tr><th>Titre</th><th>AnnĂ©e</th><th>Pays</th></tr>

<?php 
  $connexion
=mysql_pconnect("localhost","ifips","ifips");
  
mysql_select_db("ifips",$connexion);

  
$resultat=mysql_query("SELECT * FROM Films ORDER BY Titre");

  if(!
$resultat) {
    echo 
"Erreur MySQL : ".mysql_error($connexion);        
  } else {
    while(
$ligne=mysql_fetch_array($resultat,MYSQL_ASSOC)) {
      echo 
"<tr>";
      echo 
"<td>".htmlspecialchars(stripslashes($ligne["Titre"]))."</td>";
      echo 
"<td>".htmlspecialchars(stripslashes($ligne["Annee"]))."</td>";
      echo 
"<td>".htmlspecialchars(stripslashes($ligne["Pays"]))."</td>";
      
?>
      <td><form action="supprimer.php">
        <div>
      <input type="hidden" name="titre" value="<?php echo htmlspecialchars(stripslashes($ligne['Titre'])); ?>" />
      <input type="submit" value="Supprimer" />
    </div>
      </form></td> 
      <?php
      
echo "</tr>";
    }
  }
?>
</table>
<hr />
<p>
<a href="ajout_nouveau_film.html">Ajouter un nouveau film</a>
</p>

</body>
</html>