Ver Mensaje Individual
  #2 (permalink)  
Antiguo 19/07/2008, 00:01
Avatar de eZakto
eZakto
 
Fecha de Ingreso: julio-2008
Mensajes: 214
Antigüedad: 15 años, 9 meses
Puntos: 5
Respuesta: Problemacon catalogo de fotos ...

Prueba esto para el último:
Código PHP:
<?php
include("conec.php");
//$cn=mysql_connect($host,$user,$password);
//mysql_select_db($db,$cn);
$titu=$_POST["titu"];
$noticia=$_POST["noticia"];
$fecha=$_POST["fecha"];
mysql_query("insert into casosc values ('', '".$titu."', '".$noticia."', 'n', '".$fecha."', 'n','n');"$cn);
$ssql "SELECT MAX(id_noticia) AS mayor FROM casosc;";
//Ejecuto la sentencia
$rs mysql_query($ssql,$cn);
$res mysql_fetch_array($rs);
if (
is_uploaded_file($HTTP_POST_FILES['archivo']['tmp_name'])) {
if(
$HTTP_POST_FILES['archivo']['size'] < 400000) {
if(
$HTTP_POST_FILES['archivo']['type']=="image/gif" || $HTTP_POST_FILES['archivo']['type']=="image/jpeg" || $HTTP_POST_FILES['archivo']['type']=="image/pjpeg") {
if(
move_uploaded_file($HTTP_POST_FILES['archivo']['tmp_name'], "img/".$HTTP_POST_FILES['archivo']['name'])) {
mysql_query("update casosc set foto = '".$HTTP_POST_FILES['archivo']['name']."' where id_noticia = $res[0];",$cn);
}
else {
mysql_close($cn);
header ("Location: menerrornotireg.php");
exit();
}
}
}
}

if (
is_uploaded_file($HTTP_POST_FILES['archivo1']['tmp_name']) && is_uploaded_file($HTTP_POST_FILES['archivo2']['tmp_name'])) {
if(
$HTTP_POST_FILES['archivo1']['size'] < 400000 && $HTTP_POST_FILES['archivo2']['size'] < 400000) {
if((
$HTTP_POST_FILES['archivo1']['type']=="image/gif" || $HTTP_POST_FILES['archivo1']['type']=="image/jpeg" || $HTTP_POST_FILES['archivo1']['type']=="image/pjpeg") && ($HTTP_POST_FILES['archivo2']['type']=="image/gif" || $HTTP_POST_FILES['archivo2']['type']=="image/jpeg" || $HTTP_POST_FILES['archivo2']['type']=="image/pjpeg")) {
if(
move_uploaded_file($HTTP_POST_FILES['archivo1']['tmp_name'], "img/".$HTTP_POST_FILES['archivo1']['name'] && move_uploaded_file($HTTP_POST_FILES['archivo2']['tmp_name'], "img/".$HTTP_POST_FILES['archivo2']['name']))) {
mysql_query("update casosc set foto1 = '".$HTTP_POST_FILES['archivo1']['name']."', foto2 = '".$HTTP_POST_FILES['archivo2']['name']."' where id_noticia = $res[0];",$cn);
mysql_close($cn);
header ("Location: administrarcasos.php");
exit();
}
else {
mysql_close($cn);
header ("Location: menerrornotireg.php");
exit();
}
}
}
}
}
?>
Igualmente he de decirte que el código es desastroso.

Saludos.