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
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1250">
<meta name="generator" content="PSPad editor, www.pspad.com">
<title>inscription</title>
</head>
<body>
<?php
$base="basepersonne";
$connexion=mysql_connect("localhost","root","");
mysql_select_db('basepersonne',$connexion);
$requete="SELECT * ".
"FROM contact ";
$requete2 = "SELECT COUNT(*) ".
"FROM basepersonne.contact;";
$compteur = mysql_query($requete2);
$total = mysql_result($compteur,0);
$resultat=mysql_db_query($base,$requete,$connexion);
$sql=mysql_query($requete,$connexion);
$requete3='SELECT *'.
'FROM contact;';
$boucle = mysql_query($requete3);
$totaux =0;
echo $totaux ;
while($ligne = mysql_fetch_array($boucle))
{
if ($totaux < $ligne[0])
{
$totaux = $ligne[0];
}
}
$template_inscription=
'<form action="inscription.php" name="inscription" method="POST">'.
'<table id="tab_inscription">'.
'<tr>'.
'<td colspan="2">Mlle<input type="radio" name="mademoiselle" value="Mlle"/>'.
'Mme<input type="radio" name="madame" value="Mme"/>'.
'M<input type="radio" name="monsieur" value="M"/></td>'.
'<td>adresse</td><td colspan="3"><input type="text" name="adresse"/></td>'.
'</tr>'.
'<tr>'.
'<td>nom</td><td><input type="text" name="nom"/></td>'.
'<td>prenom</td><td><input type="text" name="prenom"/></td>'.
'<td>code postal</td><td><input type="text" name="cp"/></td>'.
'</tr>'.
'<tr>'.
'<td>email</td><td><input type="text" name="email"/></td>'.
'<td>telephone</td><td><input type="text" name="tel"/></td>'.
'<td>ville</td><td><input type="text" name="ville"/></td>'.
'</tr>'.
'<tr>'.
'<td> <input type="submit" name="envoyer" value="envoyer"></td>'.
'</tr>'.
'<tr>'.
'</table></form>';
echo $template_inscription;
if($_SERVER['REQUEST_METHOD']=='POST')
{
if(isset($_POST["envoyer"])&& $_POST["envoyer"]== 'envoyer')
{
for($j=1;$j<=$total;$j++)
{
if($_POST["envoyer"])
{
$requete="INSERT INTO `basepersonne`.`contact` (`id` ,`sexe` ,`nom` ,`prenom` ,`adresse` ,`cp` ,`email` ,`tel` ,`ville` )
VALUES (NULL , 'm', 'gggghh', 'fgffrgggt', 'fgtghhyhty', '55655', 'fgfgtthtbhgh', '55616', 'ftgyhgyhyj')";
mysql_query($requete);
}
}
}
}
?>
</body>
</html> |
Partager