Código PHP:
<?
/*
$server = $_SERVER["SERVER_NAME"];
$uri = "/clavel2/admin/uploads/";
$upload_dir = $server.$uri;
*/
// Validacion de formularios directo desde cargador. No realizo validacion pr javascript para que no me agarren las variables al momento de hacer el envio POST
//Mover direccion temporal de FOTO 1 a DIRECCION FINAL en images/noticias/chicas
if ($sin_foto1 != "TRUE")
{
$n_path_foto1 = $upload_dir_thumbs . $n_foto1;
$resultado1 = move_uploaded_file($n_foto1_tmp, $n_path_foto1);
if (!$resultado1)
{
echo "ERROR: El archivo no pudo ser cargado al servidor";
exit;
}
}
//Mover direccion temporal de FOTO 2 a DIRECCION FINAL en images/noticias/chicas
if ($sin_foto2 != "TRUE")
{
$n_path_foto2 = $upload_dir_thumbs . $n_foto2;
$resultado2 = move_uploaded_file($n_foto2_tmp, $n_path_foto2);
if (!$resultado2)
{
echo "ERROR: El archivo no pudo ser cargado al servidor";
exit;
}
}
//Mover direccion temporal de FOTO 3 a DIRECCION FINAL en imagse/noticias/grandes
if ($sin_foto3 != "TRUE")
{
$n_path_foto3 = $upload_dir_grandes . $n_foto3;
$resultado3 = move_uploaded_file($n_foto3_tmp, $n_path_foto3);
if (!$resultado3)
{
echo "ERROR: El archivo no pudo ser cargado al servidor";
exit;
}
}
//Mover direccion temporal del FICHERO a DIRECCION FINAL en ficheros/noticias
if ($sin_fichero != "TRUE")
{
$n_path_fichero = $upload_ficheros . $n_fichero;
$resultado4 = move_uploaded_file($n_fichero_tmp, $n_path_fichero);
if (!$resultado4)
{
echo "ERROR: El archivo no pudo ser cargado al servidor";
exit;
}
}
********************************************************
if (!get_magic_quotes_gpc())
{
$n_foto1 = addslashes($n_foto1);
$n_foto2 = addslashes($n_foto2);
$n_foto3 = addslashes($n_foto3);
$n_fichero = addslashes($n_fichero);
$n_path_foto1 = addslashes($n_path_foto1);
$n_path_foto2 = addslashes($n_path_foto2);
$n_path_foto3 = addslashes($n_path_foto3);
$n_path_fichero = addslashes($n_path_fichero);
}
$sql = "INSERT INTO tabla (titulo, detalle, nom_foto1, path_foto1, nom_foto2, path_foto2, nom_foto3, path_foto3, nom_fichero, path_fichero, fecha, orden, estado, tipo1, tipo2, tipo3, tipo4)
VALUES ('$titulo', '$detalle', '$n_foto1', '$n_path_foto1', '$n_foto2', '$n_path_foto2', '$n_foto3', '$n_path_foto3', '$n_fichero', '$n_path_fichero', '$fecha', '$orden' , '1', '$tipofile1', '$tipofile2', '$tipofile3', '$tipofile4')";
//echo $sql;
$resultado = mysql_query($sql);
if (!$resultado)
{
'Error, La consulta falló : '.mysql_error();
}
else {
echo "<script>window.location = 'admin.php?op=noticias'; </script>";
}
}
?>
SIGUE... ULTIMA PARTE.... (SORRY POR FLOOD... PEROE S NECESARIO... SON MAS DE 10000 CARACTERES....