Salve è poco che utilizzo il php ho un problema molto strano che non riesco a risolvere:
Ho creato una pagina html con all'interno un questionario, l'utente una volta compilato il questionario invia il risultato su un file da me creato a cui posso accedere solo io, solo che all'utene gli compare il risultato esatto, mentre sul file che ho creato io no!!!!E quando vado a leggere i risultati non va a capo ma li mette di seguito!!!HELP!!!!! di sequito vi riporto il programmino da me creato per dare il risultato all'utente...
<?
#
#
$tot=0;
if (( !$HTTP_GET_VARS[nome] ) || ( !$HTTP_GET_VARS[cognome] ) || ( !$HTTP_GET_VARS[email])) {
echo "
Non tutti i campi sono stati riempiti, devi ritornare alla <A HREF=\"Questionario_linux.html\" >home page</A>
";
}
else
{
if(!$punt=fopen("archivio","a+"))
{
echo "Impossibile aprire il file";
exit;
}
else
{
fputs($punt,$HTTP_GET_VARS["nome"]);
fputs($punt," ");
fputs($punt,$HTTP_GET_VARS["cognome"]);
fputs($punt," -(");
fputs($punt,$HTTP_GET_VARS["email"]);
fputs($punt,")- punteggio = ");
fputs($punt, $tot);
fputs($punt,"\n");
}
if (($HTTP_GET_VARS[1]=="b"))
{
$tot = $tot+1;
}
if (($HTTP_GET_VARS[2]=="f"))
{
$tot = $tot+1;
}
if (($HTTP_GET_VARS[3]=="i"))
{
$tot = $tot+2;
}
if (($HTTP_GET_VARS[4]=="p"))
{
$tot = $tot+1;
}
if (($HTTP_GET_VARS[5]=="v"))
{
$tot = $tot+1.5;
}
if (($HTTP_GET_VARS[6]=="b22"))
{
$tot = $tot+1;
}
if (($HTTP_GET_VARS[7]=="e2"))
{
$tot = $tot+1;
}
if (($HTTP_GET_VARS[8]=="l2"))
{
$tot = $tot+1;
}
if (($HTTP_GET_VARS[9]=="q2"))
{
$tot = $tot+0.5;
}
if (($HTTP_GET_VARS[10]=="u2"))
{
$tot = $tot+1;
}
if (($HTTP_GET_VARS[11]=="a3"))
{
$tot = $tot+0.5;
}
if (($HTTP_GET_VARS[12]=="e3"))
{
$tot = $tot+1;
}
echo "Il tuo punteggio totalizzato è:" .$tot. "
";
fclose($punt);}
?>
Mentre questo è il programma che ho cretao che mi fa leggere i risultati del questionario...
<?
#
# script per la lettura di un file sequenziale
#
if(!$punt=fopen("archivio","r")){
echo "Spiacente non posso aprire il file";
exit;
}
else{
while(!feof($punt)){
$nome=fgets($punt,255);
echo "$nome";
$cognome=fgets($punt,255);
echo "$cognome";
$email=fgets($punt,255);
echo "$email";
$tot=fgets($punt,255);
echo " $tot ";
echo "
";
}
}
fclose($punt);
?>
VI PREGO AIUTATEMI!!!!!grazie....![]()