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
| <?php
include("fonctions.php");
?>
<html>
<head><title>LCEsa</title></head>
<link href="test.css" media="all" rel="stylesheet" type="text/css" />
<body>
<div id="bandeau">
<h1>LCEsa</h1>
</div>
<div id="menu">
<h2>Selectionnez le traitement de votre choix: </h2>
</div>
<div id="contenu">
<?php
session_start();
$_SESSION['nom']=$_POST['nom'];
echo 'Vous avez selectionné precedemment : '.$_SESSION['nom'].'<br /> ';
?>
<?php
// on se connecte à MySQL
$db = mysql_connect('localhost', 'root', '');
// on sélectionne la base
mysql_select_db('lcesa',$db);
// on crée la requête SQL
$sql = 'SELECT * FROM machine';
// on envoie la requête
$req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error());
?>
<form method="post" action="titre.php">
<?php
// on fait une boucle qui va faire un tour pour chaque enregistrement
while($data = mysql_fetch_array($req))
{
// on affiche les informations de l'enregistrement en cours
echo '<button type="submit" name="machine" class="btn_machine"><b>'.$data['Nom'].' </b> .' . '</button>';
}
// on ferme la connexion à mysql
mysql_close();
?>
</form>
</div>
</body>
</html> |