Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Olá pessoal,
to tentando fazer umas coisinhas bem simples, mas não tá dando certo mesmo...
olhem ai meu código
<?phpchmod ("../fotos/", 0777);function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue; switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue;}$editFormAction = $_SERVER['PHP_SELF'];if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);}$foto = $_FILES['caminho_foto']['name'];$foto_tmp = $_FILES['caminho_foto']['name_tmp'];$local = "c:\wamp\www\dream\fotos";if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) { $insertSQL = sprintf("INSERT INTO fotos (legenda_foto, data_foto, caminho_foto) VALUES (%s, NOW(), '$foto')", GetSQLValueString($_POST['legenda_foto'], "text"), GetSQLValueString($_POST['caminho_foto'], "text")); move_uploaded_file($foto_tmp, "$local/$foto"); mysql_select_db($database_con_fenasoja, $con_fenasoja); $Result1 = mysql_query($insertSQL, $con_fenasoja) or die(mysql_error());}?>
simplismente a foto não vai para o caminho especificado e no banco fica o nome da foto
Uso o wampserver 1.6.4
PORQUE Não ta Gravando?
Abraços
Carregando comentários...