PDA

View Full Version : [PHP] Parse error: parse error, unexpected T_STRING..chi mi aiuta??


MrEnrich
10-11-2005, 01:27
stavo smanettando un pò con PHP e avevo creato questo modulo HTML :

<form method="post" action="http://localhost/argomenti.php">
Nome: <input type="text" NAME="nome" SIZE="40"><BR>
Password: <input type="password" NAME="password" SIZE="20"><br><br>
Quali argomenti vuoi approfondire?<br>
<input type="checkbox" NAME="html" VALUE="html">Info su HTML<BR>
<input type="checkbox" NAME="immagini" VALUE="immagini">Immagini e oggetti<br>
<input type="checkbox" NAME="url" VALUE="url">Collegamenti e URL<br>
<input type="checkbox" NAME="oggetti" VALUE="oggetti">Oggetti multimediali<br>
<input type="checkbox" NAME="xhtml" VALUE="xhtml">XHTML v. 1.0<br>
<hr width="100%"><br>
<input type="submit" NAME="invia" VALUE="INVIA!">
<input type="reset" NAME="cancella" VALUE="CANCELLA TUTTO!">
</form>

dopodichè ho creato il file relativo PHP per stampare il modulo:
<?php
$nome=$_POST['nome'];
$password=$_POST['password'];
$html=$_POST['html'];
$immagini=$_POST['immagini];
$url=$_POST['url];
$oggetti=$_POST['oggetti'];
$xhtml=$_POST['xhtml'];
echo "<table border=\"1\">";
echo "<tr><td>";
printf ("%s", $nome);
echo "</tr></td";
echo "<tr><td>";
printf ("%s", $password);
echo "</tr></td>";
echo "<tr><td>";
printf ("%s", $html);
echo "</tr></td>";
echo "<tr><td>";
printf ("%s",$immagini);
echo "</tr></td>";
echo "<tr><td>";
printf ("%s",$url);
echo "</tr></td>";
echo "<tr><td>";
printf ("%s",$oggetti);
echo "</tr></td>";
echo "<tr><td>";
printf ("%s",$xhtml);
echo "</tr></td>";
echo "</table>
?>

PURTROPPO mi da SEMPRE questo errore... provando a modificare in tutti i modi... ho provato anche a creare un array nel form html, creando un ciclo for nel php per stampare l'array ma niente... sempre questo errore.........
chi mi da 1 mano?

Parse error: parse error, unexpected T_STRING, expecting ']' in E:\Programmi\Apache Group\Apache2\htdocs\argomenti.php on line 6

max246
10-11-2005, 06:38
:D :D :D :D :D

$url=$_POST['url]; --> manca una ' alla fine di URL :P per quello che ti da errore... :ciapet: :ciapet: :ciapet:

MrEnrich
11-11-2005, 15:36
grazie ora funge :D

cmq ho 1 altro problema:

#Controlla se la password è esatta
$queryutente="(SELECT password FROM users WHERE (utente='$login'))";
$risultat=mysql_query($queryutente);
$dbpass=mysql_fetch_array($risultat,MYSQL_ASSOC);
if($pass != $dbpass[0])
die("La password inserita è sbagliata, torna indietro riscrivila correttamente");

mi dice:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource ....

come risolvo?
Grazie

kk3z
11-11-2005, 18:58
prova a togliere le parentesi in prima ed ultima posizione della stringa della query