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 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
<head>
<title>Titre</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" media="screen" type="text/css" title="Style" href="style.css" />
</head>
<body>
<!-- L'en-tête -->
<div id="en_tete">
</div>
<!-- Les menus -->
<div id="menu">
<div class="element_menu">
<h3>Menu 1</h3>
<ul>
<li><a href="#">Lien 1</a></li>
<li><a href="#">Lien 2</a></li>
</ul>
</div>
<div class="element_menu"><br>
<h3>Menu 2</h3>
<ul>
<li><a href="#">Lien 1</a></li>
<li><a href="#">Lien 2</a></li>
</ul>
</div>
</div>
<div id="corps">
<br><h2>Ajouter un adherent</h2>
<form name="insertion" method="POST">
<table border="0" align="center" cellspacing="2" cellpadding="2">
<tr align="center">
<td>Numéro adherent:</td>
<td><input type="text" name="numadh"></td>
</tr>
<tr align="center">
<td>Nom adherent:</td>
<td><input type="text" name="nomadh"></td>
</tr>
<tr align="center">
<td colspan="2"><input type="submit" value="Insérer"></td>
</tr>
</table>
</form>
<?php
$connexion=mysql_connect("*****", "*****", "*****");
if (!$connexion) {
echo "La connexion au serveur a échouée<br>";
exit;
}
if(!mysql_select_db("*****", $connexion)) {
echo "La connexion à la base de données à échouée<br>";
exit;
}
if (!isset($_REQUEST["numadh"])) exit;
if (!isset($_REQUEST["nomadh"])) exit;
$numint=$_POST["numadh"];
$nomint=$_POST["nomadh"];
if (!empty($numadh) & !empty($nomadh)) {
$sql= "insert into adherents values ('".$numadh."','".$nomadh."')";
$requete= MYSQL_QUERY($sql, $connexion);
echo("L'insertion a été correctement effectuée") ;
}
else echo("<font color=red>Erreur lors de l'insertion des données.</font>") ;
mysql_close($connexion);
?>
</div>
<!-- Le pied de page -->
<div id="pied_de_page">
<p>Nom du site</p>
</div>
</body>
</html> |