Ver Mensaje Individual
  #9 (permalink)  
Antiguo 31/10/2006, 06:34
Avatar de yesik
yesik
 
Fecha de Ingreso: octubre-2004
Ubicación: Orense
Mensajes: 292
Antigüedad: 19 años, 7 meses
Puntos: 1
error desconocido en tiempo de ejecucion ..jaja muy aclarativo..

bueno te dejo toda la pagins... sobre la linea 30 esta el error

<?php
session_start();
?>
<script type="text/javascript" language="JavaScript">

function previsualizar(controlFichero,idImg,momento,tam){
var laImagen = document.getElementById(idImg);
laImagen.removeAttribute("width");
laImagen.removeAttribute("height");
laImagen.onload = function(){
var ratio = this.offsetWidth/this.offsetHeight;
this.height = tam;
this.width = this.height*ratio;};
if(momento == "previs"){
laImagen.src="file://"+controlFichero.value;
}else{
if(momento == "subir"){
laImagen.src="file://"+controlFichero.value;
}else{
laImagen.src = controlFichero.src;
}
}
}

function comprobar(){alert('comprobar')}

function comprobarimagen(){
if(document.getElementById('fichero').value == ''){
alert('Debe seleccionar una imagen para subir.');
}else{
var indice = document.frmFoto.indice.value;
var indicefila = document.frmFoto.indicefila.value;
var tabla = document.getElementById('tablaimg');
var imagen = "imgPrevSub"+indice;
if(indice != 4){
filaimg = document.getElementById('fila'+indicefila);
var filaimg2 = document.getElementById('fila'+indicefila+'_1');
var imagen = "imgPrevSub"+indice;
tabla.innerHTML+= '<tr id="fila0" height="100"></tr><tr id="fila0_1"></tr>';
filaimg.innerHTML+='<td width="25%" class="inputtabla"><img id="imgPrevSub0" name="imgFoto0" src="../imaxes/casatabla.jpg"></td>';
filaimg2.innerHTML+='<td width="25%" align="center"><input type="button" name"borrar" onClick="Javascript:Comprobar();"></td>';



previsualizar(document.getElementById('fichero').n ame,imagen,'subir',100);
}/*else{
document.frmFoto.indicefila.value = document.frmFoto.indicefila.value + 1;
indicefila = document.frmFoto.indicefila.value;
document.frmFoto.indice.value = 0;
indice = document.frmFoto.indice.value;
imagen = "imgPrevSub"+indice;
filaimg = document.getElementById('fila'+indicefila);
filaimg2 = document.getElementById('fila'+indicefila+'.1');
filaimg.innerHTML += '<td width="25%" class="inputtabla"><img id="imgPrevSub1" name="imgFoto1" src="../imaxes/casatabla.jpg"></td>';
filaimg2.innerHTML += '<td width="25%" align="center"><?php require_once ("../modulos/funciones.php");boton("altacasa.php","Borrar");?></td>';
previsualizar(document.getElementById('fichero'),i magen,'subir',100);
}*/
document.frmFoto.indice.value = document.frmFoto.indice.value + 1;
document.getElementById('fichero').value = "";
alert(document.getElementById('fichero').name);
}
}
</script>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="Description" content="Encuentra tu vivienda en Galicia alquileres,ventas,promociones,traspasos." />
<meta name="Keywords" content="alquilar piso, alquilar casa, compra piso, compra casa, compra terreno, comprar piso, comprar casa, venta piso, venta casas, venta pisos, venta casas, pisos, casas, inmuebles, galicia, alquiler, venta, alquilar vivienda, vivienda, alquilar, inmobiliaria, buscar casa, buscar piso, encontrar casa, encontrar piso " />

<meta name="author" content="InmuebleVirtual.net" />
<meta name="locality" content="Spain" />
<meta name="lang" content="es" />
<meta name="language" content="Spanish" />
<meta name="robots" content="ALL" />
<meta name="resource-type" content="document" />
<meta name="revisit-after" content="7 days" />
<meta name="rating" content="General" />
<meta name="distribution" content="Global" />
<title>Agregar imágenes</title>
</head>

<link href="../estilos/formularios.css" type="text/css" rel="stylesheet"/>
<link href="../estilos/clasetabla.css" rel="stylesheet" type="text/css">

<body onload="javascript:previsualizar(document.frmFoto. imgFoto,'imgPrev','inicio',250);" style="margin:0px; font-family: Verdana, Geneva, Arial, helvetica, sans-serif;">
<form name="frmFoto" action="?" method="post" enctype="multipart/form-data">
<input type="hidden" name="control" value="0">
<input type="hidden" name="indice" value="0">
<input type="hidden" name="indicefila" value="0">
<table class="ventana" width="100%" height="100%">
<tr>
<td class="titulo">Agregar imágenes a su inmueble</td>
<td align="right"><img src="../iconos/eliminar.gif" align="middle" alt="Salir" onMouseOver="this.style.cursor='pointer'" onClick="window.close">
</td>
</tr>
<tr>
<td colspan="2">
<table align="center" class="tablafotos" width="96%" height="100%">
<tr>
<td width="75%"><label class="label">Seleccionar imagen</label>
<input type="hidden" name="MAX_FILE_SIZE" value="1000">
<input id="fichero" type="file" name="" size="50" class="input2" onBlur="this.className='input2'" onfocus="this.className='input1'" onchange="previsualizar(this,'imgPrev','previs',25 0);" tabindex="1">
<script type="text/javascript">
document.getElementById('fichero').name = 'foto'+document.frmFoto.indice.value;
</script>
</td>
<td align="left" width="25%">
<?php require_once ("funciones.php");
boton("javascript:comprobarimagen()","Agregar");
?>
</td>
</tr>
<tr>
<td colspan="3" class="alt_centro">Las imágenes no deben superar 200Kb de tamaño.</td>
</tr>
<tr>
<td class="label" width="15%">Previsualización</td>
<td></td>
<td></td>
</tr>
<tr height="130">
<td width="25%" class="inputtabla">
<div id="divimg"><img id="imgPrev" name="imgFoto" src="../imaxes/casatabla.jpg" height="60" width="150"></div>
</td>
<td></td>
<td></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2">
<table id="tablaimg" align="center" class="tablafotos" width="96%" height="100%">
<tr>
<td width="36%" colspan="3"><label class="label">Imagenes subidas</label></td>
<td width="30%"></td>
<td width="30%"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2">
<?php require_once ("./funciones.php");
boton("","Guardar Imagenes");?>
</td>
</tr>
</table>
</form>
</body>
__________________
Inmuebles de Galicia:: www.inmueblevirtual.net
Compartir piso Galicia:: www.inmueblevirtual.net/foro