![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
Tengo un codigo para un upload multiple que utilizo en mi pagina , y me funciona de maravilla, pero con un problemita, como siempre un pero y es que despues que suben las fotos la pagina resultante no me muestra un mensaje que diga que subieron bien los archivos etc. Aunque si subieron bien, por el contarrio muestra una pagina con un poco de letras, por favor algien que me ayude a configurar ese codigo para que me de un mensaje satisfactorio por favorsito
Este es el cogido:
<?php
error_reporting(E_ALL);
@ini_set('display_errors', '1');
/*----------- INICIO DE CONFIGURACION-----------------*/
//definir el nombre o la ip del servidor de db
$server='localhost';
//definir el nombre de usuario de la db
$user='';
//definir la contraseña
$pass='';
//definir el nombre de la db
$db='';
//en la siguiente línea, definir el nombre de la tabla de la db (escribirlo entre las comillas simples).
$tabla='';
//en esta otra línea colocar el nombre del archivo a mostrar al finalizar el proceso (escribirlo entre las comillas simples)
$destino='';
/*----------- FIN DE LA CONFIGURACION-----------------*/
mysql_connect($server,$user,$pass);
mysql_select_db($db);
function insertar_form($tabla){
foreach($_POST as $k => $v){
if($k!='imageField_x' && $k!='imageField_y' && $k!='foto' && $k!='foto1' && $k!='foto2' && $k!='foto3' && $k!='foto4' && $k!='Submit'){
$listacampos[]=$k;
$listavalores[]=(get_magic_quotes_gpc()) ? $v : addslashes($v);
}}
$formatocampos=implode(',',$listacampos);
$formatovalores="'".implode("','",$listavalores);
$formatovalores.="'";
mysql_query("insert into $tabla ($formatocampos) values ($formatovalores)");
}
function subirarchivo($archivo,$archivotemp,$tabla,$campoar chivo,$error){
$qry=mysql_query("select max(id) as ultimo from $tabla");
$row=mysql_fetch_assoc($qry);
$id=$row['ultimo'];
if($archivo!=''){
$extension200=end(explode(".",strtolower($archivo) ));
if($extension200!='jpg' && $extension200!='gif' && $extension200!='png' && $extension200!='doc' && $extension200!='zip' && $extension200!='pdf' && $extension200!='xls' && $extension200!='ppt' && $extension200!='swf'){
eval($error);exit;}
$foto2=md5(time()).$archivo;
if(!copy($archivotemp,$foto2)){die('No pudo cargarse la foto');};
@chmod($foto2,0777);
mysql_query("update $tabla set $campoarchivo='$foto2' where id='$id'");
}
}
insertar_form($tabla);
if(isset($_FILES['foto']['name'])){
subirarchivo($_FILES['foto']['name'],$_FILES['foto']['tmp_name'],$tabla,'foto','');
}
for($i=1;$i<4;$i++){
if(isset($_FILES['foto'.$i]['name'])){
subirarchivo($_FILES['foto'.$i]['name'],$_FILES['foto'.$i]['tmp_name'],$tabla,'foto'.$i,'');}
}
header("Location:$destino");
?>
El mensaje que da en cuestión actualmente es este :
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'granclas'@'localhost' (using password: NO) in /home/granclas/public_html/upload4.php on line 18
Warning: mysql_select_db() [function.mysql-select-db]: Access denied for user 'granclas'@'localhost' (using password: NO) in /home/granclas/public_html/upload4.php on line 19
Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in /home/granclas/public_html/upload4.php on line 19
Warning: mysql_query() [function.mysql-query]: Access denied for user 'granclas'@'localhost' (using password: NO) in /home/granclas/public_html/upload4.php on line 29
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/granclas/public_html/upload4.php on line 29
Warning: mysql_query() [function.mysql-query]: Access denied for user 'granclas'@'localhost' (using password: NO) in /home/granclas/public_html/upload4.php on line 32
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/granclas/public_html/upload4.php on line 32
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/granclas/public_html/upload4.php on line 33
Warning: mysql_query() [function.mysql-query]: Access denied for user 'granclas'@'localhost' (using password: NO) in /home/granclas/public_html/upload4.php on line 42
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/granclas/public_html/upload4.php on line 42
Warning: mysql_query() [function.mysql-query]: Access denied for user 'granclas'@'localhost' (using password: NO) in /home/granclas/public_html/upload4.php on line 32
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/granclas/public_html/upload4.php on line 32
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/granclas/public_html/upload4.php on line 33
Warning: mysql_query() [function.mysql-query]: Access denied for user 'granclas'@'localhost' (using password: NO) in /home/granclas/public_html/upload4.php on line 42
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/granclas/public_html/upload4.php on line 42
Warning: mysql_query() [function.mysql-query]: Access denied for user 'granclas'@'localhost' (using password: NO) in /home/granclas/public_html/upload4.php on line 32
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/granclas/public_html/upload4.php on line 32
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/granclas/public_html/upload4.php on line 33
Warning: mysql_query() [function.mysql-query]: Access denied for user 'granclas'@'localhost' (using password: NO) in /home/granclas/public_html/upload4.php on line 42
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/granclas/public_html/upload4.php on line 42
Warning: mysql_query() [function.mysql-query]: Access denied for user 'granclas'@'localhost' (using password: NO) in /home/granclas/public_html/upload4.php on line 32
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/granclas/public_html/upload4.php on line 32
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/granclas/public_html/upload4.php on line 33
Warning: mysql_query() [function.mysql-query]: Access denied for user 'granclas'@'localhost' (using password: NO) in /home/granclas/public_html/upload4.php on line 42
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/granclas/public_html/upload4.php on line 42
Warning: mysql_query() [function.mysql-query]: Access denied for user 'granclas'@'localhost' (using password: NO) in /home/granclas/public_html/upload4.php on line 32
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/granclas/public_html/upload4.php on line 32
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/granclas/public_html/upload4.php on line 33
Warning: mysql_query() [function.mysql-query]: Access denied for user 'granclas'@'localhost' (using password: NO) in /home/granclas/public_html/upload4.php on line 42
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/granclas/public_html/upload4.php on line 42
Warning: mysql_query() [function.mysql-query]: Access denied for user 'granclas'@'localhost' (using password: NO) in /home/granclas/public_html/upload4.php on line 32
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/granclas/public_html/upload4.php on line 32
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/granclas/public_html/upload4.php on line 33
Warning: mysql_query() [function.mysql-query]: Access denied for user 'granclas'@'localhost' (using password: NO) in /home/granclas/public_html/upload4.php on line 42
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/granclas/public_html/upload4.php on line 42
Warning: Cannot modify header information - headers already sent by (output started at /home/granclas/public_html/upload4.php:18) in /home/granclas/public_html/upload4.php on line 53