bonjour à tous,

Je souhaite mettre en forme plusieurs formulaire avec un seul bouton envoi, ceci est-il possible?

soit:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
 
<?php
require('configuration.php');
$nombreEntrees = mysql_query("SELECT id  FROM sondage ") or die(mysql_error());
$numeroDuFormulaire = mysql_fetch_assoc($nombreEntrees);
$id_formulaire = $numeroDuFormulaire;
 
echo '<form method="post" name="sondage" >';
 
$req="SELECT question, proposition1, proposition2, proposition3, proposition4, proposition5 FROM sondage where id='1'    ";
$MySQL_infos = mysql_query($req) or die(mysql_error());
$infos = mysql_fetch_array($MySQL_infos);
//On sélectionne le nombre de votes
$MySQL_votes = mysql_query("SELECT resultats1, resultats2, resultats3,resultats4,resultats5 FROM sondage WHERE id = '1'") or die(mysql_error());
$votes = mysql_fetch_assoc($MySQL_votes);
//script pour ajouter les votes et ip
$ip = $_SERVER['REMOTE_ADDR'];
$prop = "prop";
 
$resultat = "resultats";
$fin = false;
if(isset($_POST['sondage']))
{
	for($i = 1; $i <= 5 && !$fin; $i++)
	{
		if($_POST['sondage'] == $prop . $i)
		{
			$votes[$resultat . $i] ++;
			mysql_query("UPDATE sondage SET  " . $resultat . $i . " = '" . $votes[$resultat . $i] . "' WHERE id = '1'") or die(mysql_error());
			$fin = true;
		}
	}
}
if ($infos['question'] != "")
echo '<div class="archives">'.stripslashes($infos['question']).'</div>'.''. "";
if ($infos['proposition1'] != "")
echo  '<div class="date">'.stripslashes($infos['proposition1']).'</div>'.'<font style=" font-family: Verdana, Arial, Helvetica, sans-serif;  font-size: 10px;">'.  "<input type='radio' name='sondage' value='prop1' id='prop1' /> <label for='prop1'>" .'<img src="img/sondage/vert_gauche.gif">'.'<img src="img/sondage/vert.gif" height="14" width="' . $pourcentage_r1 / 100 * $long_max_bloc . '" alt="'.round($pourcentage_r1).'%" />' . '<img src="img/sondage/vert_droite.gif"/> ' . round($pourcentage_r1) . "% (".$result["resultats1"].($result["resultats1"] > 1 ? ' votes' : ' vote').")</font>";
if ($infos['proposition2'] != "")
echo  '<div class="date">'.stripslashes($infos['proposition2']).'</div>'.'<font style=" font-family: Verdana, Arial, Helvetica, sans-serif;  font-size: 10px;">'.  "<input type='radio' name='sondage' value='prop2' id='prop2' /> <label for='prop2'>" .'<img src="img/sondage/vert_gauche.gif">'.'<img src="img/sondage/vert.gif" height="14" width="' . $pourcentage_r1 / 100 * $long_max_bloc . '" alt="'.round($pourcentage_r1).'%" />' . '<img src="img/sondage/vert_droite.gif"/> ' . round($pourcentage_r1) . "% (".$result["resultats1"].($result["resultats1"] > 1 ? ' votes' : ' vote').")</font>";
if ($infos['proposition3'] != "")
echo  '<div class="date">'.stripslashes($infos['proposition3']).'</div>'.'<font style=" font-family: Verdana, Arial, Helvetica, sans-serif;  font-size: 10px;">'.  "<input type='radio' name='sondage' value='prop3' id='prop3' /> <label for='prop3'>" .'<img src="img/sondage/vert_gauche.gif">'.'<img src="img/sondage/vert.gif" height="14" width="' . $pourcentage_r1 / 100 * $long_max_bloc . '" alt="'.round($pourcentage_r1).'%" />' . '<img src="img/sondage/vert_droite.gif"/> ' . round($pourcentage_r1) . "% (".$result["resultats1"].($result["resultats1"] > 1 ? ' votes' : ' vote').")</font>";
if ($infos['proposition4'] != "")
echo  '<div class="date">'.stripslashes($infos['proposition4']).'</div>'.'<font style=" font-family: Verdana, Arial, Helvetica, sans-serif;  font-size: 10px;">'.  "<input type='radio' name='sondage' value='prop4' id='prop4' /> <label for='prop4'>" .'<img src="img/sondage/vert_gauche.gif">'.'<img src="img/sondage/vert.gif" height="14" width="' . $pourcentage_r1 / 100 * $long_max_bloc . '" alt="'.round($pourcentage_r1).'%" />' . '<img src="img/sondage/vert_droite.gif"/> ' . round($pourcentage_r1) . "% (".$result["resultats1"].($result["resultats1"] > 1 ? ' votes' : ' vote').")</font>";
if ($infos['proposition5'] != "")
echo  '<div class="date">'.stripslashes($infos['proposition5']).'</div>'.'<font style=" font-family: Verdana, Arial, Helvetica, sans-serif;  font-size: 10px;">'.  "<input type='radio' name='sondage' value='prop5' id='prop5' /> <label for='prop5'>" .'<img src="img/sondage/vert_gauche.gif">'.'<img src="img/sondage/vert.gif" height="14" width="' . $pourcentage_r1 / 100 * $long_max_bloc . '" alt="'.round($pourcentage_r1).'%" />' . '<img src="img/sondage/vert_droite.gif"/> ' . round($pourcentage_r1) . "% (".$result["resultats1"].($result["resultats1"] > 1 ? ' votes' : ' vote').")</font>";
//echo '<input type="image" width="75" src="img/sondage/voter.gif"  name="submit !"/>';
echo'</form>';
echo '<form method="post" name="sondage" >';
$req="SELECT question, proposition1, proposition2, proposition3, proposition4, proposition5 FROM sondage where id='2'    ";
$MySQL_infos = mysql_query($req) or die(mysql_error());
$infos = mysql_fetch_array($MySQL_infos);
//On sélectionne le nombre de votes
$MySQL_votes = mysql_query("SELECT resultats1, resultats2, resultats3,resultats4,resultats5 FROM sondage WHERE id = '2'") or die(mysql_error());
$votes = mysql_fetch_assoc($MySQL_votes);
//script pour ajouter les votes et ip
$ip = $_SERVER['REMOTE_ADDR'];
$prop = "prop";
 
$resultat = "resultats";
$fin = false;
if(isset($_POST['sondage']))
{
	for($i = 1; $i <= 5 && !$fin; $i++)
	{
		if($_POST['sondage'] == $prop . $i)
		{
			$votes[$resultat . $i] ++;
			mysql_query("UPDATE sondage SET  " . $resultat . $i . " = '" . $votes[$resultat . $i] . "' WHERE id = '2'") or die(mysql_error());
			$fin = true;
		}
	}
}
if ($infos['question'] != "")
echo '<div class="archives">'.stripslashes($infos['question']).'</div>'.''. "";
if ($infos['proposition1'] != "")
echo  '<div class="date">'.stripslashes($infos['proposition1']).'</div>'.'<font style=" font-family: Verdana, Arial, Helvetica, sans-serif;  font-size: 10px;">'.  "<input type='radio' name='sondage' value='prop1' id='prop1' /> <label for='prop1'>" .'<img src="img/sondage/vert_gauche.gif">'.'<img src="img/sondage/vert.gif" height="14" width="' . $pourcentage_r1 / 100 * $long_max_bloc . '" alt="'.round($pourcentage_r1).'%" />' . '<img src="img/sondage/vert_droite.gif"/> ' . round($pourcentage_r1) . "% (".$result["resultats1"].($result["resultats1"] > 1 ? ' votes' : ' vote').")</font>";
if ($infos['proposition2'] != "")
echo  '<div class="date">'.stripslashes($infos['proposition2']).'</div>'.'<font style=" font-family: Verdana, Arial, Helvetica, sans-serif;  font-size: 10px;">'.  "<input type='radio' name='sondage' value='prop2' id='prop2' /> <label for='prop2'>" .'<img src="img/sondage/vert_gauche.gif">'.'<img src="img/sondage/vert.gif" height="14" width="' . $pourcentage_r1 / 100 * $long_max_bloc . '" alt="'.round($pourcentage_r1).'%" />' . '<img src="img/sondage/vert_droite.gif"/> ' . round($pourcentage_r1) . "% (".$result["resultats1"].($result["resultats1"] > 1 ? ' votes' : ' vote').")</font>";
if ($infos['proposition3'] != "")
echo  '<div class="date">'.stripslashes($infos['proposition3']).'</div>'.'<font style=" font-family: Verdana, Arial, Helvetica, sans-serif;  font-size: 10px;">'.  "<input type='radio' name='sondage' value='prop3' id='prop3' /> <label for='prop3'>" .'<img src="img/sondage/vert_gauche.gif">'.'<img src="img/sondage/vert.gif" height="14" width="' . $pourcentage_r1 / 100 * $long_max_bloc . '" alt="'.round($pourcentage_r1).'%" />' . '<img src="img/sondage/vert_droite.gif"/> ' . round($pourcentage_r1) . "% (".$result["resultats1"].($result["resultats1"] > 1 ? ' votes' : ' vote').")</font>";
if ($infos['proposition4'] != "")
echo  '<div class="date">'.stripslashes($infos['proposition4']).'</div>'.'<font style=" font-family: Verdana, Arial, Helvetica, sans-serif;  font-size: 10px;">'.  "<input type='radio' name='sondage' value='prop4' id='prop4' /> <label for='prop4'>" .'<img src="img/sondage/vert_gauche.gif">'.'<img src="img/sondage/vert.gif" height="14" width="' . $pourcentage_r1 / 100 * $long_max_bloc . '" alt="'.round($pourcentage_r1).'%" />' . '<img src="img/sondage/vert_droite.gif"/> ' . round($pourcentage_r1) . "% (".$result["resultats1"].($result["resultats1"] > 1 ? ' votes' : ' vote').")</font>";
if ($infos['proposition5'] != "")
echo  '<div class="date">'.stripslashes($infos['proposition5']).'</div>'.'<font style=" font-family: Verdana, Arial, Helvetica, sans-serif;  font-size: 10px;">'.  "<input type='radio' name='sondage' value='prop5' id='prop5' /> <label for='prop5'>" .'<img src="img/sondage/vert_gauche.gif">'.'<img src="img/sondage/vert.gif" height="14" width="' . $pourcentage_r1 / 100 * $long_max_bloc . '" alt="'.round($pourcentage_r1).'%" />' . '<img src="img/sondage/vert_droite.gif"/> ' . round($pourcentage_r1) . "% (".$result["resultats1"].($result["resultats1"] > 1 ? ' votes' : ' vote').")</font>";
echo'</form>';
echo '<br />';
//echo '<input type="image" width="75" src="img/sondage/voter.gif"  name="sondage"/>';
 
echo '<br/>';
//echo '<input type="image" width="75" src="img/sondage/voter.gif"  name="submit !"/>';
echo '<form method="post" name="sondage" >';
$req="SELECT question, proposition1, proposition2, proposition3, proposition4, proposition5 FROM sondage where id='3'    ";
$MySQL_infos = mysql_query($req) or die(mysql_error());
$infos = mysql_fetch_array($MySQL_infos);
//On sélectionne le nombre de votes
$MySQL_votes = mysql_query("SELECT resultats1, resultats2, resultats3,resultats4,resultats5 FROM sondage WHERE id = '3'") or die(mysql_error());
$votes = mysql_fetch_assoc($MySQL_votes);
//script pour ajouter les votes et ip
$ip = $_SERVER['REMOTE_ADDR'];
$prop = "prop";
 
$resultat = "resultats";
$fin = false;
if(isset($_POST['sondage']))
{
	for($i = 1; $i <= 5 && !$fin; $i++)
	{
		if($_POST['sondage'] == $prop . $i)
		{
			$votes[$resultat . $i] ++;
			mysql_query("UPDATE sondage SET  " . $resultat . $i . " = '" . $votes[$resultat . $i] . "' WHERE id = '3'") or die(mysql_error());
			$fin = true;
		}
	}
}
if ($infos['question'] != "")
echo '<div class="archives">'.stripslashes($infos['question']).'</div>'.''. "";
if ($infos['proposition1'] != "")
echo  '<div class="date">'.stripslashes($infos['proposition1']).'</div>'.'<font style=" font-family: Verdana, Arial, Helvetica, sans-serif;  font-size: 10px;">'.  "<input type='radio' name='sondage' value='prop1' id='prop1' /> <label for='prop1'>" .'<img src="img/sondage/vert_gauche.gif">'.'<img src="img/sondage/vert.gif" height="14" width="' . $pourcentage_r1 / 100 * $long_max_bloc . '" alt="'.round($pourcentage_r1).'%" />' . '<img src="img/sondage/vert_droite.gif"/> ' . round($pourcentage_r1) . "% (".$result["resultats1"].($result["resultats1"] > 1 ? ' votes' : ' vote').")</font>";
if ($infos['proposition2'] != "")
echo  '<div class="date">'.stripslashes($infos['proposition2']).'</div>'.'<font style=" font-family: Verdana, Arial, Helvetica, sans-serif;  font-size: 10px;">'.  "<input type='radio' name='sondage' value='prop2' id='prop2' /> <label for='prop2'>" .'<img src="img/sondage/vert_gauche.gif">'.'<img src="img/sondage/vert.gif" height="14" width="' . $pourcentage_r1 / 100 * $long_max_bloc . '" alt="'.round($pourcentage_r1).'%" />' . '<img src="img/sondage/vert_droite.gif"/> ' . round($pourcentage_r1) . "% (".$result["resultats1"].($result["resultats1"] > 1 ? ' votes' : ' vote').")</font>";
if ($infos['proposition3'] != "")
echo  '<div class="date">'.stripslashes($infos['proposition3']).'</div>'.'<font style=" font-family: Verdana, Arial, Helvetica, sans-serif;  font-size: 10px;">'.  "<input type='radio' name='sondage' value='prop3' id='prop3' /> <label for='prop3'>" .'<img src="img/sondage/vert_gauche.gif">'.'<img src="img/sondage/vert.gif" height="14" width="' . $pourcentage_r1 / 100 * $long_max_bloc . '" alt="'.round($pourcentage_r1).'%" />' . '<img src="img/sondage/vert_droite.gif"/> ' . round($pourcentage_r1) . "% (".$result["resultats1"].($result["resultats1"] > 1 ? ' votes' : ' vote').")</font>";
if ($infos['proposition4'] != "")
echo  '<div class="date">'.stripslashes($infos['proposition4']).'</div>'.'<font style=" font-family: Verdana, Arial, Helvetica, sans-serif;  font-size: 10px;">'.  "<input type='radio' name='sondage' value='prop4' id='prop4' /> <label for='prop4'>" .'<img src="img/sondage/vert_gauche.gif">'.'<img src="img/sondage/vert.gif" height="14" width="' . $pourcentage_r1 / 100 * $long_max_bloc . '" alt="'.round($pourcentage_r1).'%" />' . '<img src="img/sondage/vert_droite.gif"/> ' . round($pourcentage_r1) . "% (".$result["resultats1"].($result["resultats1"] > 1 ? ' votes' : ' vote').")</font>";
if ($infos['proposition5'] != "")
echo  '<div class="date">'.stripslashes($infos['proposition5']).'</div>'.'<font style=" font-family: Verdana, Arial, Helvetica, sans-serif;  font-size: 10px;">'.  "<input type='radio' name='sondage' value='prop5' id='prop5' /> <label for='prop5'>" .'<img src="img/sondage/vert_gauche.gif">'.'<img src="img/sondage/vert.gif" height="14" width="' . $pourcentage_r1 / 100 * $long_max_bloc . '" alt="'.round($pourcentage_r1).'%" />' . '<img src="img/sondage/vert_droite.gif"/> ' . round($pourcentage_r1) . "% (".$result["resultats1"].($result["resultats1"] > 1 ? ' votes' : ' vote').")</font>";
 
echo '<br />';
//echo '<input type="image" width="75" src="img/sondage/voter.gif"  name="sondage"/>';
 
echo '<br/>';
echo '<input type="image" width="75" src="img/sondage/voter.gif"  name="submit !"/>';
 
 
echo'</form>';
?>
mon probléme le script prend en compte que le dernier formulaire mais je souhaiterais qui prend en compte ensemble des votes
merci d'avance