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 70 71
| <?php
$connect = mysql_connect('localhost','root','')
or die ("erreur de connexion");
mysql_select_db('final',$connect)
or die ("erreur de connexion base");
$result = mysql_query("SELECT * FROM firewall");
?>
<html>
<head>
<title>update</title>
</head>
<body>
<p align="center"><strong><u>Modifier un équipement</u></strong></p>
<table width="350" border="0" align="center" cellpadding="5" cellspacing="0" bgcolor="#eeeeee">
<tr>
<th>code</th><th>marque</th><th>nb_ports</th>
</tr>
<?php
for ($i=0; $i < mysql_num_rows($result); ++$i)
{
echo '<tr>';
mysql_data_seek($result, $i);
$champs = mysql_fetch_array($result);
for ($col=0; $col<4; ++$col)
echo '<td>'.$champs[$col].'</td>';
$vars= 'code='.$champs[0];
echo '<td><a href="modifier1.php?'.$vars.'">Modifier</a></td></tr>';
}
?>
</table>
<?php
import_request_variables("G","recu_");
$connect = mysql_connect('localhost','root','')
or die ("erreur de connexion");
mysql_select_db('final',$connect)
or die ("erreur de connexion base");
$resultSelect = mysql_query("SELECT code, marque, nb_ports
FROM firewall WHERE code=\"$recu_code\" ");
$champs = mysql_fetch_object($resultSelect);
?>
<p>
Modification des renseignements sur le firewall :<br>
<form method="post" action="modifier111.php">
<table width="360" border="0" align="center" cellpadding="5" cellspacing="0" bgcolor="#eeeeee">
<tr>
<th>code</th><th>marque</th><th>nb_ports</th>
</tr>
<tr>
<td width="300"><?php echo $recu_code; ?><input type="hidden" name="code"
value="<?php echo $recu_code; ?>" ></td>
<td><input type="text" name="marque"
value="<?php echo $champs->marque; ?>" ></td>
<td><input type="text" name="nb_ports"
value="<?php echo $champs->nb_ports; ?>" ></td>
</tr>
<tr>
<td height="50" colspan="10" align="center"><div align="center">
<input type="submit" name="submit" value="Modifier cet equipement">
</div></td>
</tr>
</table>
</form>
</p>
</body>
</html> |
Partager