ho un problema a memorizzare le immagini nei campi blob.
ho scritto il seguente codice (consultando le varie guide sul sito) e và tutto bene escluso la memorizzazione dell'immagine nel campo blob. il campo risulta vuoto. dove sbaglio?
grazie
---> insert.php
<?
include ("config.inc.php");
include ("top_foot.inc.php");
//intestazione
top();
?>
<form name="form1" method="post" action="save.php" enctype="multipart/form-data">
<table width="90%" border="0" align="center" cellpadding="2" cellspacing="2" bgcolor="#E9E9E9">
<tr>
<td colspan="3"></td>
</tr>
<tr>
<td width="20%">Titolo:</td>
<td width="59%"><input type="text" size=40 name="titolo">
</td>
<td width="21%"></td>
</tr>
<tr>
<td>Autore:</td>
<td><input type="text" size=40 name="autore">
</td>
<td></td>
</tr>
<tr>
<td>E-mail:</td>
<td><input type="text" size=40 name="mail">
</td>
<td></td>
</tr>
<tr>
<td>Testo:</td>
<td><textarea cols=60 rows=10 name="testo"></textarea>
</td>
<td></td>
</tr>
<tr>
<td>Foto:</td>
<td><input name="foto" type="file">
</td>
<td><input type="submit" value="Invia">
</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td colspan="3"></td>
</tr>
</table>
</form>
</p>
-----> save.php
<? include("top_foot.inc.php");
include("config.inc.php");
top();
if ($pass != $password):
echo "Password errata";
elseif (trim(titolo) == "" OR trim(testo) == ""):
echo "I campi Titolo e Testo devono essere riempiti!";
else:
$titolo = addslashes(stripslashes($titolo));
$autore = addslashes(stripslashes($autore));
$mail = addslashes(stripslashes($mail));
$testo = addslashes(stripslashes($testo));
$titolo = str_replace("<", "<", $titolo);
$titolo = str_replace(">", ">", $titolo);
$autore = str_replace("<", "<", $autore);
$autore = str_replace(">", ">", $autore);
$testo = str_replace("<", "<", $testo);
$testo = str_replace(">", ">", $testo);
$testo = nl2br($testo);
$db = mysql_connect($db_host, $db_user, $db_password);
if ($db == FALSE)
die ("Errore nella connessione. Verificare i parametri nel file config.inc.php");
mysql_select_db($db_name, $db)
or die ("Errore nella selezione del database. Verificare i parametri nel file config.inc.php");
$query1 = "INSERT INTO news (titolo, testo, nome, foto) VALUES ('$titolo', '$testo', '$autore', '$foto')";
$query2 = "INSERT IGNORE INTO autori (nome, mail) VALUES ('$autore', '$mail')";
if (mysql_query($query1, $db) AND mysql_query($query2, $db))
echo "L'articolo è stato inserito correttamente";
else
echo "Erorre durante l'inserimento
$query";
endif;
foot();
?>