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
| <?php
mysql_connect("localhost", "...", "...");
mysql_select_db("...");
if (isset($_GET['modifier_circ']))
{
$_GET['modifier_circ'] = mysql_real_escape_string(htmlspecialchars($_GET['modifier_circ']));
$retour = mysql_query('SELECT * FROM circulaires WHERE id=\'' . $_GET['modifier_circ'] . '\'');
$donnees = mysql_fetch_array($retour);
$nom = stripslashes($donnees['nom']);
$description = stripslashes($donnees['description']);
$lien = stripslashes($donnees['lien']);
$image = stripslashes($donnees['image']);
$categorie = stripslashes($donnees['categorie']);
$id_circ = $donnees['id'];
}
else
{
$nom = '';
$description = '';
$lien = '';
$image = '';
$categorie = '';
$id_circ = 0;
}
?>
<form name="formulaire" action="liste_circ.php" method="post">
<p>Nom de l'entreprise : <input type="text" size="30" name="nom" value="<?php echo $nom; ?>" /></p>
<p>Description :<br /><textarea name="description;" cols="50" rows="10">
<?php echo $description; ?>
</textarea></p>
<p>Catégorie :<br />
<?php
$retour = mysql_query('SELECT * FROM circcat ORDER BY id DESC');
while ($data = mysql_fetch_array($retour))
{
?>
<input type="radio" name="categorie" value="<?php echo $data['titre']; ?>" id="<?php echo $data['titre']; ?>" /> <label><?php echo $data['titre']; ?></label><br />
<?php
}
?></p>
<p>Lien : <input type="text" size="70" name="lien" value="<?php echo $lien; ?>" /></p>
<p>Image : <input type="text" size="70" name="image" value="<?php echo $image; ?>" /></p>
<p><input type="hidden" name="id_circ" value="<?php echo $id_circ; ?>" />
<input type="submit" value="Envoyer" /></p>
</form> |
Partager