Listing en php qui ne fonctionne pas

LaurentK -  
Archeus01 Messages postés 1572 Date d'inscription   Statut Membre Dernière intervention   -
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 1572 Date d'inscription   Statut Membre Dernière intervention   452
 
$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