Ayuda con php

Hola apolinux, soy muy novato en lo que es php, para un sitio web tuve que progrmar un buscador. Resulta que cuando quiero ejecutar el mismo me sale el siguiente error:
Parse error: syntax error, unexpected $end in I:\FerozoWebHosting\semperenagomez.com.uy\public_html\buscarnumero.php on line 399
Acontinuacion te pego el codigo fuente de la página a ver si me podes ayudar a descubrir cual es el error, porque se produce el error y como lo soluciono y asi aprendo.
El codigo es el siguiente:
<html>
<head>
<link rel="shortcut icon" href="favicon.ico" >
<title>SemperenaGomez - Negocios Inmobiliarios</title>
<style>
A:hover {color:#FF7300;}
A {
text-decoration: none;
color:000000;
font-size: 11;
font-family: verdana;
font:900;
}
TD{
FONT-SIZE:11;
FONT-FAMILY:verdana;
COLOR:000000;
}
input{
FONT-SIZE:11;
FONT-FAMILY:verdana;
COLOR:000000;
}
font.bold{font:900;color:ffffff}
font.right{color:ffffff}
font.left{font-size:12}
</style>
<script language='JavaScript' type='text/JavaScript'>
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
<body LEFTMARGIN='0' TOPMARGIN=0 MARGINWIDTH='0' MARGINHEIGHT='0'>
<table height='100%' cellspacing='0' cellpadding='0' border='0' bordercolor='000000'>
<tr>
<td width='50%' background='images/bg.jpg'></td>
<td background='images/bg_lft.jpg' style='padding-left:28'></td>
<td>    </td>
<td bgcolor='#FFFFFF' valign='top' height='100%'>
<table width='760' height='100%' border='0' cellpadding='0' cellspacing='0'>
<tr>
<td>
<embed src="cabezal.swf" width="760" height="250" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" ></embed>
</td>
</tr>
<tr>
<td valign="top" height="43" background="images/back_for_search.jpg">
<table border="0" cellpadding="0" cellspacing="0" width="760">
<form action="buscar.php" method="post">
<tr>
<td style="padding-left:100;padding-top:14" width="80"><img src="images/search.gif" border="0" height="18" alt=""></td>
<td style="padding-top:14" width="70">
<select maxlength="30" style='font: 8pt verdana';'width:70' name="tipo" id="select5">
<option value='0'>Tipo</option>
<option value='1'>Casa</option>
<option value='2'>Apto.</option>
<option value='3'>Chalet</option>
<option value='4'>Local</option>
<option value='5'>Terreno</option>
<option value='6'>Campo</option>
</select>
</td>
<td style="padding-left:5;padding-top:14" width="100">
<?
//Incluimos datos para la conexion a la DB
require_once("common/conn.php");
//********* Conexion *******************
$conexion=mysql_connect($host,$user,$pass);
mysql_select_db($base,$conexion) ;
$sqls="SELECT * FROM localidad";
$resultzona=mysql_query($sqls,$conexion);
?>
<select maxlength='40' value='localidad' style='font: 8pt verdana';'width:100' name='zona'>
<option value='0'>Zona</option>";
<?
WHILE ($rowzona=mysql_fetch_array($resultzona))
{
if ($rowzona['id'] == $row['zona'])
$seleciona="selected";
else
$seleciona="";
echo "<option value='".$rowzona['id']."' ".$seleciona.">".$rowzona['local']."</option>";
}
?>
</select>
</td>
<td style='padding-left:5;padding-top:14' width='100'>
<select maxlength='40' value='password' style='font: 8pt verdana';'width:100' name='esta'>
<option value='0'>Operacion </option>
<option value='1'>Venta</option>
<option value='2'>Alquiler</option>
</select>
</td>
<td style='padding-left:5;padding-top:14' width='100'>
<select maxlength='40' align='right' value='costo' style='font: 8pt verdana';'width:100' name='costo'>
<option value='0'>Costo U\$S</option>
<option value='250'>Hasta 250</option>
<option value='500'>De 250 a 500</option>
<option value='1000'>De 500 a 1000</option>
<option value='2000'>De 1000 a 2000</option>
<option value='4000'>De 2000 a 4000</option>
<option value='8000'>De 4000 a 8000</option>
<option value='15000'>De 8000 a 15.000</option>
<option value='30000'>Mas de 15.000</option>
</select>
</td>
<td style='padding-top:14' width='200'><input type='image' src='images/go_but.gif' border='0' width='18' height='18' alt=''></td>
</tr>
</form>
</table>
</td>
</tr>
<tr>
<td valign='top' height='100%' width='51'>
<table border='0' cellpadding='0' cellspacing='0' width='760' height='100%'>
<tr>
<?
$registros = 24;
if (!$pagina)
{
$inicio = 0;
$pagina = 1;
}
else
{
$inicio = ($pagina - 1) * $registros;
}
if ($numero > "0")
{ $resultados = mysql_query( "SELECT numsof FROM propiedades WHERE numsof ='$numero'") ;
$total_registros = mysql_num_rows($resultados);
$total_paginas = ceil($total_registros / $registros);
}
else
{
if ($tipo !="0" and $zona !="0" and $costo !="0")
{ $resultados = mysql_query("SELECT numsof FROM propiedades WHERE tipo = '$tipo' and zona = '$zona' and venta <= '$costo' and estado !='2' and estado !='3' and...

1 respuesta

Respuesta
1
Ese error es por una llave '}' que falta. La verdad no te sabría decir pues tu codigo es algo denso. Te sugiero lo siguiente:
- Identar todos los bloques, lo puedes hacer por ej asi:
if (cond ){
     if ( cond2 ) {
          ...codigo ...
     }
     else {
         ...mas codigo ...
     }
}
Es decir usar tabuladores por cada bloque anidado, para detectar mas facil el error.
- Reorganizar tu codigo para parametrizar, veo mucho codigo repetido de consultas mysql, te sugiero dejar un solo codigo de consultas si es posible y parametrizar los valores numericos.

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas