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
|
<div id="texte_corps"><br><br>
<form method="post" action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>">
<select name="PC">
<?php
try {
$req = $bdd->query('SELECT * FROM nom_pc order by pc');
while ($row = $req->fetch(PDO::FETCH_ASSOC))
{
echo '<option value="',htmlspecialchars($row['id']),'">',htmlspecialchars($row['pc']),'</option>\n';
}
}
catch (PDOException $e) {
echo $e->getMessage();
}
?>
<form method="post" action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>">
<select name="OS">
<?php
try {
$req = $bdd->query('SELECT * FROM systeme_exploitation order by os');
while ($row = $req->fetch(PDO::FETCH_ASSOC))
{
echo '<option value="',htmlspecialchars($row['id']),'">',htmlspecialchars($row['os']),'</option>\n';
}
}
catch (PDOException $e) {
echo $e->getMessage();
}
if (isset($_POST['submit_update'], $_POST['OS'])){
$req = $bdd->prepare('INSERT INTO nom_pc SET nom_pc.pc_os = ?');
$req->execute(array($_POST['OS']));
}
?>
<br>
<br>
<input type="submit" name="submit_update" /> |
Partager