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
| <FORM Method="POST" Action="Anagramme.php">
<p class="Style2 style20">
<table width="370">
<tr>
<td><select name="titre">
<option></option>
<option><font face="Arial"><font size="3">dance</font> </option>
<option><font face="Arial"><font size="3">insecte </font></font> </option>
</select></td>
</tr>
<tr>
<td colspan=2 align="center"><input name="submit" type=submit value=JOUER>
<INPUT type=hidden name=afficher value=ok>
</td>
</tr>
</table>
</FORM>
<?php if (isset($_POST['recherche']))
{
// j'affiche au dessus du formulaire
}
else
{
// j'affiche rien au dessus du formulaire
}
// et ici mon formulaire
?>
<?php
// Connexion à la base de données
$link = mysql_connect("mysql", "user****", "****")
or die("Impossible de se connecter : " . mysql_error());
// Sélection de la base de données
mysql_select_db("db08***");
// On est connectés, on peut travailler sur la BDD
// On fait une boucle pour lister tout ce que contient la table :
$reponse = mysql_query("SELECT * FROM anagramme WHERE titre ='$titre' ");
?>
<?php
while($donnees = mysql_fetch_array($reponse) or die(mysql_error()))
{
$titre = $donnees['titre'];
$ana1 = $donnees['ana1'];
$sol1 = $donnees['sol1'];
$ana2 = $donnees['ana2'];
$sol2 = $donnees['sol2'];
$ana3 = $donnees['ana3'];
$sol3 = $donnees['sol3'];
$ana4 = $donnees['ana4'];
$sol4 = $donnees['sol4'];
$ana5 = $donnees['ana5'];
$sol5 = $donnees['sol5'];
$ana6 = $donnees['ana6'];
$sol6 = $donnees['sol6'];
$ana7 = $donnees['ana7'];
$sol7 = $donnees['sol7'];
$ana8 = $donnees['ana8'];
$sol8 = $donnees['sol8'];
$ana9 = $donnees['ana9'];
$sol9 = $donnees['sol9'];
$ana10 = $donnees['ana10'];
$sol10 = $donnees['sol10'];
$afficher = 'ok'
?>
<table width="500" border="1">
<tr>
<td width="100"><span class="Style8"><?php echo $ana1; ?></span></td>
<td width="100"><input name="sol1" type="text"></td>
</tr>
<td width="100"><span class="Style8"><?php echo $ana2; ?></span></td>
<td width="100"><input name="sol1" type="text"></td>
</table>
<?php |
Partager