Bonsoir j'ai un message lorsque que je demande de rechercher le nom d'un joueur.. J'ai creer dans ma base Mysql une liste Joueur. Voila mes différents programmes :
Voila mon code php :Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" href="accueil.css" type="text/css" /> <title>Le Rugby</title> </head> <body> <form enctype="multipart/form-data" action="joueur.php" method="post"> <div class="rechercher"> <div> <label for="recherche"></label><input type="text" name="recherche" value="Tapez le nom d'un joueur" id="recherche"/>****** </div> <div> <input type="submit" value="Rechercher" /> </div> </form> </body> </html>
Et voila ma derniere page :Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Joueur</title> </head> <body> <?php foreach ($_REQUEST)as $cle => $valeur) { echo " $valeur "; } ?> </body> </html>
Et voila le message d'erreur :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 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" href="style.css" type="text/css" /> <title>Joueur</title> </head> <body> <h1>Joueur</h1> <table> <tr><td>Nom</td><td>Prenom</td><td>Date de naissance</td><td>Club</td></tr> <?php $connexion = mysql_pconnect("localhost","planchon","planchon"); if (!$connexion) {echo "<p>Erreur connexion !</p>";exit;} if (!mysql_select_db("ifips",$connexion)) {echo "Sélection de la base impossible !";exit;} $resultat= mysql_query("SELECT * FROM joueur",$connexion); while ($joueur=mysql_fetch_array($resultat,MYSQL_ASSOC)) {echo "<tr><td>".$joueur["Nom"]."</td><td>".$joueur["Prenom"]."</td><td>".$joueur["Date de naissance"]."</td><td>".$joueur["Club"]."</td></tr>\n";} mysql_close($connexion); ?> </table> </body> </html>
Merci de l'aide!!!:roll:Code:$valeur) { echo " $valeur "; } ?>