ciao a tutti!
ho questo codice e vorrei riuscire ad inserire un'immagine nel db
<?php
include('function/config.inc');
session_start();
$flag = $_POST['flag'];
$nome = $_POST['nome'];
$cognome = $_POST['cognome'];
$user =$_POST['user'];
$password = $_POST['password'];
$mail = $_POST['mail'];
$ruolo = $_POST['ruolo'];
if (is_uploaded_file($_FILES['foto']['tmp_name'])) {
$foto = "../fototeam/".$_FILES['foto']['name'];
move_uploaded_file($_FILES['foto']['tmp_name'],$foto);
}
else { $foto = ""; }
if ($flag == 99) {
$query="INSERT INTO utenti (nome,cognome,user,password,mail,ruolo,foto) VALUES ('$nome','$cognome','$user','$password','$mail','$ ruolo','$foto')";
// echo "QUERY INSERIMENTO: ".$query;
mysql_query($query,$connessione) or die('Could not connect:' .mysql_error());
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Inserisci nel team!</title>
</head>
<body>
<center>
<h1>Inserisci nel team!</h1>
<form action="inserisciteam2.php" method="post" style="border: medium solid red;"class="modulo" enctype="multipart/form-data">
<input type="hidden" name="flag" value="99">
<table border="0" cellspacing="5" cellpadding="6" width="350">
<tr>
<td width="150">Nome:</td>
<td width="200"><input type="text" name="nome"></td>
</tr>
<tr>
<td width="150">Cognome:</td>
<td width="200"><input type="text" name="cognome"></td>
</tr>
<tr>
<td width="150">User:</td>
<td width="200"><input type="text" name="user" value=""></td>
</tr>
<tr>
<td width="150">Password:</td>
<td width="200"><input type="text" name="password" value=""></td>
</tr>
<tr>
<td width="150">E-mail:</td>
<td width="200"><input type="text" name="mail"></td>
</tr>
<tr>
<td width="150">Ruolo:</td>
<td width="200"><input type="text" name="ruolo"></td>
</tr>
<tr>
<td width="150">Foto:</td>
<td width="200"><input type="file" name="foto"></td>
</tr>
<tr>
<td width="150"><input type="reset" value="Svuota Modulo"></td>
<td width="200"><input type="submit" name="submit" value="Inserisci"></td>
</tr>
</table>
</form>
</center>
</body>
<?php
mysql_close($connessione);
?>
</html>
la cosa che nn mi torna è che l'immagine appare nella tabella del db come percorso, ma non appare nella cartella "fototeam".
come mai?