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
|
<form name="avis" action="donnezavis.php" method = "POST">
<input type="hidden" name="suite" value= "1">
<table border="1">
<?php
$result=mysql_query("SELECT Nom, NumeroInscription FROM inscription WHERE Nom ='".$_SESSION['pseudo']."';");
while($row = mysql_fetch_array($result))
{
?><tr>
<td>Votre nom d'inscrit : </td>
<td><input type="text" disabled="disabled" value =" <?php echo $row[0] ?>"></td></tr><br>
<?php
}
$adresse = mysql_real_escape_string($_GET['adresse']) ;
?>
<tr>
<td>L'adresse de la maison : </td>
<td><input type = "text" disabled="disabled" value = "<?php echo $adresse ?>"></td></tr><br>
<tr>
<td>Votre avis : </td>
<td><textarea cols=30 rows=10 name="avis"></textarea></td></tr></table>
<input type="submit" value="Envoyer mon avis">
<input type="hidden" name="suite" value="1">
</form>
<?php
if (isset($_POST['suite']))
{
if ($_POST['suite'] == 1)
{
$avis = $_POST['avis'];
$numeromaison = mysql_real_escape_string($_GET['numeromaison']) ;
echo $numeromaison;
$req = "INSERT INTO avis SET NumeroMaison = '".$numeromaison."' , NumeroInscription = '".$row[1]."' , AvisInscrit = '".$avis."'";
$resultat = mysql_query($req);
echo "INSERT INTO avis SET NumeroMaison = '".$numeromaison."' , NumeroInscription = '".$row[1]."' , AvisInscrit = '".$avis."'";
}
} |
Partager