Listing en php qui ne fonctionne pas

Fermé
LaurentK - 26 janv. 2010 à 19:51
Archeus01 Messages postés 1567 Date d'inscription mercredi 3 octobre 2007 Statut Membre Dernière intervention 9 juin 2022 - 27 janv. 2010 à 11:46
Bonjour,

M'occupant d'un site pour une association, j'ai actuellement un problème concernant un formulaire d'inscription.

L'inscription semble bien se passer (un mail reprenant les informations est envoyé) mais elle n'apparaît pas dans le fichier de listing.

Voici le code du doc php :

<?

if ($pass == "X") {

mysql_connect("X","X","X");
mysql_select_db("X");
$req = mysql_query("SELECT * FROM inscription_rplus ORDER BY id");

?>

<table cellpadding="5" style="border-collapse:collapse;border:solid 1px black" width="100%">
<tr>
<td><p style="font-family:arial;font-size:10pt;"><b>NOM</b></p></td>
<td><p style="font-family:arial;font-size:10pt;"><b>PRENOM</b></p></td>
<td><p style="font-family:arial;font-size:10pt;"><b>EMAIL</b></p></td>
<td><p style="font-family:arial;font-size:10pt;"><b>ENTREPRISE</b></p></td>
<td><p style="font-family:arial;font-size:10pt;"><b>COCKTAIL</b></p></td>

</tr>

<?

while ($f = mysql_fetch_array($req)) {
echo ('

<tr><td><p style="font-family:arial;font-size:10pt;">'.$f[nom].'</p></td>
<td><p style="font-family:arial;font-size:10pt;">'.$f[prenom].'</p></td>
<td><p style="font-family:arial;font-size:10pt;">'.$f[email].'</p></td>
<td><p style="font-family:arial;font-size:10pt;">'.$f[entreprise].'</p></td>
<td><p style="font-family:arial;font-size:10pt;">'.$f[cocktail].'</p></td></tr>'); }


?>

</table>

<? } else {

echo '<table cellpadding="5" style="border-collapse:collapse;border:solid 1px black" width="100px">
<tr>
<td><p style="font-family:arial;font-size:10pt;"><b>IDENTIFICATION</b></p></td>
<tr><td>
<form method=GET action=listing.php><input type=password name=pass value=pass><br><input type=submit value=valider name=v></form> </td></tr></table>'; }

?>

En vous remerciant par avance, je vous souhaite une bonne soirée.
A voir également:

1 réponse

Archeus01 Messages postés 1567 Date d'inscription mercredi 3 octobre 2007 Statut Membre Dernière intervention 9 juin 2022 447
27 janv. 2010 à 11:46
$f[nom]... nom est une constante définie quelque part? Parce que je crois que tu veux plutot le champ nom de ta base auquel cas le code correct est
$f['nom'] (idem pour les autres lignes).
0