kk3z
14-06-2004, 19:13
ho queste due pagine
la pagina con il form
<html>
<head>
</head>
<body>
<form name="upload" method="post" action="invia.php">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="16%" height="30" class="carattere"> </td>
<td width="13%" height="30" class="carattere"><div align="left">Domanda:</div></td>
<td width="71%" height="30" colspan="2"><div align="left">
<input name="domanda" type="text" size="50">
</div></td>
</tr>
<tr>
<td width="16%" height="30" class="carattere"> </td>
<td width="13%" height="30" class="carattere"><div align="left">Risposta:</div></td>
<td height="30" colspan="2"><div align="left">
<input name="risposta" type="text" size="50">
</div></td>
</tr>
<tr>
<td height="30" colspan="4" class="carattere">
<div align="center">
<input type="submit" value="Invia">
<input type="reset" value="Cancella">
</div>
</td>
</tr>
</table>
</form>
</body>
</html>
e questo è il file php
<html>
<head>
</head>
<body>
<?php
$fp = fopen("domande.txt", "a");
fputs($fp, $domanda);
fclose($fp);
$fp = fopen("risposte.txt", "a");
fputs($fp, $risposta);
fclose($fp);
?>
</body>
</html>
dovrebbe scrivermi in un file quello che gli scrivo nei form, ma non lo fa...che cosa ho sbagliato?
grazie
la pagina con il form
<html>
<head>
</head>
<body>
<form name="upload" method="post" action="invia.php">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="16%" height="30" class="carattere"> </td>
<td width="13%" height="30" class="carattere"><div align="left">Domanda:</div></td>
<td width="71%" height="30" colspan="2"><div align="left">
<input name="domanda" type="text" size="50">
</div></td>
</tr>
<tr>
<td width="16%" height="30" class="carattere"> </td>
<td width="13%" height="30" class="carattere"><div align="left">Risposta:</div></td>
<td height="30" colspan="2"><div align="left">
<input name="risposta" type="text" size="50">
</div></td>
</tr>
<tr>
<td height="30" colspan="4" class="carattere">
<div align="center">
<input type="submit" value="Invia">
<input type="reset" value="Cancella">
</div>
</td>
</tr>
</table>
</form>
</body>
</html>
e questo è il file php
<html>
<head>
</head>
<body>
<?php
$fp = fopen("domande.txt", "a");
fputs($fp, $domanda);
fclose($fp);
$fp = fopen("risposte.txt", "a");
fputs($fp, $risposta);
fclose($fp);
?>
</body>
</html>
dovrebbe scrivermi in un file quello che gli scrivo nei form, ma non lo fa...che cosa ho sbagliato?
grazie