Ciao!![]()
Nel seguente form di una rubrica dopo aver inserito i dati ottengo il seguente errore
![]()
Warning: Cannot modify header information - headers already sent by (output started at e:\programmi\apache group\apache\htdocs\inseriscidati2.php:1) in e:\programmi\apache group\apache\htdocs\inseriscidati2.php on line 18
il listato che uso è il seguente :![]()
<?php
if (isset($_POST['nome'])){
include("dati.txt");
$link = mysql_connect($db_host, $db_login, $db_pass) or die (mysql_error());
mysql_select_db($database) or die (mysql_error());
$dati = "INSERT INTO rubrica VALUES ('', ";
$dati .= "'" . addslashes($_POST['titolo']) . "', ";
$dati .= "'" . addslashes($_POST['nome']) . "', ";
$dati .= "'" . addslashes($_POST['cognome']) . "', ";
$dati .= "'" . addslashes($_POST['via']) . "', ";
$dati .= "'" . addslashes($_POST['citta']) . "', ";
$dati .= "'" . addslashes($_POST['provoncia']) . "', ";
$dati .= "'" . $_POST['cap'] . "', ";
$dati .= "'" . $_POST['tel'] . "', ";
$dati .= "'" . $_POST['fax'] . "')";
mysql_query ($dati) or die (mysql_error());
echo "<meta http-equiv=refresh content=3;url=$PATH_INFO>";
Header("Location: ". $link_to_redirect);
}
?>
<html>
<head>
<meta name=Proprietà content=Apache3000>
<meta name=ProgId content=PHP Pratico>
<title>Form RUBRICA</title>
</head>
<body>
<TABLE border=0 width=100% cellpadding=3>
<tr>
<td width=100% colspan=2>
<p align=center>Inserisci nuovi recapiti nella rubrica
<form method=POST action=<? $PATH_INFO ?>>
</td>
</tr>
<tr>
<td width=18%>Titolo</td>
<td width=82%><input type=text name=titolo size=20></td>
</tr>
<tr>
<td width=18%>Nome</td>
<td width=82%><input type=text name=nome size=20></td>
</tr>
<tr>
<td width=18%>Cognome</td>
<td width=82%><input type=text name=cognome size=20></td>
</tr>
<tr>
<td width=18%>Via</td>
<td width=82%><input type=text name=via size=20></td>
</tr>
<tr>
<td width=18%>Città</td>
<td width=82%><input type=text name=citta size=20></td>
</tr>
<tr>
<td width=18%>Provincia</td>
<td width=82%><input type=text name=provincia size=20></td>
</tr>
<tr>
<td width=18%>CAP</td>
<td width=82%><input type=text name=cap size=20></td>
</tr>
<tr>
<td width=18%>Telefono</td>
<td width=82%><input type=text name=tel size=20></td>
</tr>
<tr>
<td width=18%>Cellulare</td>
<td width=82%><input type=text name=cell size=20></td>
</tr>
<tr>
<td width=18%><input type=submit value=Inserisci nuovi dati></td>
<td width=82%></form></td>
</tr>
</table>
</body>
</html>
come faccio ad correggere l' header?
Grazie![]()