Bonjour,
J'ai une page HTML dont voici le code :
Nom du fichier : bouquet.html
Code :
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
|
<html>
<br>
<body background="fond.jpg">
<h2><p align="center">Voici les différents bouquets disponibles</p></h2>
<h1><p align="left">Bouquet et Composition toutes les occasions sont bonne pour faire plaisir :</p></h2>
<form action="cbouquet.php" method="post">
<p align="center">
<table>
<tr>
<td>
<img src="IMAGE1.jpg" width=150 height=150>
<p align="center"><input type="radio" name="b" value="b1">24 € </p>
</td>
<td>
<img src="IMAGE2.jpg" width=150 height=150>
<p align="center"><input type="radio" name="b" value="b2">24 € </p>
</td>
<td>
<img src="IMAGE3.jpg" width=150 height=150>
<p align="center"><input type="radio" name="b" value="b3">24 € </p>
</td>
<td>
<img src="IMAGE4.jpg" width=150 height=150>
<p align="center"><input type="radio" name="b" value="b4">25 € </p>
</td>
</tr>
</table>
<br>
<table>
<tr>
<td>
<img src="IMAGE5.jpg" width=150 height=150>
<p align="center"><input type="radio" name="b" value="b5">25 € </p>
</td>
<td>
<img src="IMAGE6.jpg" width=150 height=150>
<p align="center"><input type="radio" name="b" value="b6">25 € </p>
</td>
<td>
<img src="IMAGE7.jpg" width=150 height=150>
<p align="center"><input type="radio" name="b" value="b7">24 € </p>
</td>
<td>
<img src="IMAGE8.jpg" width=150 height=150>
<p align="center"><input type="radio" name="b" value="b8">23 € </p>
</td>
<td>
<img src="IMAGE9.jpg" width=150 height=150>
<p align="center"><input type="radio" name="b" value="b9">29 € </p>
</td>
</tr>
</table>
<p align="center">
<input type="submit" value="Commander"></p><br>
<!-- Begin Free-Web-Buttons.com -->
<p align="center"><table id="free-web-buttons.com:id0001" width=0 cellpadding=0 cellspacing=0 border=0><tr><td title ="Retour">
<a href="accueil.html"><img src="bouquet.html.images/bt0_0.gif" border=0 alt ="Retour"></a></td><tr></table>
<noscript><a href=http://free-web-buttons.com>Free Web Buttons by Free-Web-Buttons.com</a></noscript></p>
<!-- End Free-Web-Buttons.com -->
<!--<input type="radio" name="b" value="b9">29 € </p>-->
<input type='radio' name='b' value='n'checked><!-- style='visibility:hidden;display:none'>-->
</form>
</body>
</html> |
Cette page permet de récuperer des valeurs sous forme de boutons radio, avec un code PHP que voici :
Nom du fichier : cbouquet.php
Code :
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
<?
require("connexion.php");
$bouquet=$_POST['b'];
IF($bouquet!="")
{
mysql_query("INSERT INTO `variable` VALUES('','$bouquet','','','','')") or die (mysql_error());
require("authentification.html");
}
ELSE
{
require("bouquet.html");
}
?> |
Il affiche cette erreur :
Notice: Undefined index: b in d:\easyphp 1.8\www\fleurs 200108\cbouquet.php on line 3
Logique car aucun bouton radio n'est séléctionné et donc ne renvoie aucune valeur.
Comment faire pour qu'il n'y ai pas cette erreur et qu'il recharge tout simplement la page ?