Errore in Registrazione

  • Creatore Discussione Creatore Discussione The Ark
  • Data di inizio Data di inizio

The Ark

Nuovo Utente
21 Mar 2007
5
0
0
Salve a tutti!
Bene, ecco il mio problema:
mi registro e, alla fine, non registra un bel niente!
Come posso fare?

Note:
Io uso il codice di Jacopo

PHP:
<?php
require("config.php");

echo "<h1>Registrazione</h1>\n";
if ($action == FALSE)
{
echo "<form action=\"./join.php\" method=\"post\">\n";
echo "<table width=\"100%\" border=\"0\">\n";
echo "<tr>\n";
echo "<td width=\"9%\"><strong>Username *</strong></td>\n";
echo "<td width=\"91%\"><input name=\"user\" type=\"text\"></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td><strong>Password *</strong></td>\n";
echo "<td><input name=\"pass\" type=\"text\"></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td><strong>Nome *</strong></td>\n";
echo "<td><input name=\"nome\" type=\"text\"></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td><strong>Cognome</strong></td>\n";
echo "<td><input name=\"cognome\" type=\"text\"></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td><strong>Età *</strong></td>\n";
echo "<td><input name=\"age\" type=\"text\"></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td><strong>Città</strong></td>\n";
echo "<td><input name=\"city\" type=\"text\"></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td valign=\"top\"><strong>Hobby *</strong></td>\n";
echo "<td><textarea name=\"hobby\"></textarea></td>\n";
echo "</tr>\n";
echo "<tr align=\"center\">\n";
echo "<td colspan=\"2\"><input type=\"hidden\" name=\"action\" value=\"join\"><input type=\"submit\" value=\" Join! \"></td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</form>\n";
}
else
{
if ($user==TRUE && $pass==TRUE && $nome==TRUE && $age==TRUE && $hobby==TRUE)
{
if ($cognome == FALSE) $cognome = "n/a";
if ($city == FALSE) $city = "n/a";
@mysql_query("INSERT INTO 'members' ( 'id' , 'user' , 'pass' , 'nome' , 'cognome' , 'age' , 'city' , 'hobby' )
VALUES ('',
'" . $user . "',
'" . $pass . "',
'" . $nome . "',
'" . $cognome . "',
'" . $age . "',
'" . $city . "',
'" . $hobby . "');");

echo "Grazie!<br>Registrazione effettuata correttamente!";
}
else
{
echo "Errore!<br>Non hai compilato tutti i campi obbligatori.";
}
}

@mysql_close();
?>
 
No.
In quell'articolo c'è:
Codice:
`id` , `user` , `pass` , `nome` , `cognome` , `age` , `city` , `hobby`
non:
Codice:
 'id' , 'user' , 'pass' , 'nome' , 'cognome' , 'age' , 'city' , 'hobby'
 

Discussioni simili