Bueno miren estoy implementando una web con un catalogo virtual, y al realizarla me tope con el siguiente problema me aparece el siguiente error, lo revise y no te que falta o sobra una llave lo revise y nada, aver si alguien me ayuda a encontrarlo gracias..
Parse error: parse error in C:\wamp\www\sistema-catalogo\index.php on line 273
El codigo del index.php
<?php
//Carga de datos de Conexion
require("conexion.php");
//Conexion a base de Datos SQL
$link;
mysql_select_db($sql_database);
//Buscando informacion del sistema de forma General
$buscando_infoweb = mysql_query("select * FROM infoweb where id_infoweb=1");
$infoweb = mysql_fetch_array($buscando_infoweb);
//Buscando informacion de la EMPRESA
$buscando_empresa = mysql_query("select * FROM empresa where id_empresa=1");
$empresa = mysql_fetch_array($buscando_empresa);
//CAPTURA DEL FORMULARIO
$form_categoria = $_POST['form_categoria'];
$form_producto = $_POST['form_producto'];
if($form_categoria == "si"){
$enviado = "no";
}else{
$enviado = "si";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $infoweb['titulo']; ?></title>
<link href="catalogo.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="texto_blanco" id="cuerpo_superior">
<span class="titulo_superior"><?php echo $empresa['nombre']; ?></span><br />
<?php echo $infoweb['titulo']." V.".$infoweb['version'].".0"; ?><br />
<br />
<?php
//informacion de la emrpsa
echo $empresa['direccion']."<br>";
echo "Telefono: ".$empresa['telefono']."<br>";
echo "Fax: ".$empresa['fax']."<br>";
echo $empresa['mail']."<br>";
?>
<br />
</div>
<div class="texto_blanco" id="cuerpo_info">
<table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td width="5%"><img src="imagenes/usuarios.jpg" width="16" height="16" /></td>
<td width="42%">
<?php
//Sistema de Contador
include("sist_contador.php");
?></td>
<td width="47%">
<div align="right">
<?php
//Sistema de Contador
echo date("d-m-Y");
?>
</div></td>
<td width="1%"> </td>
<td width="5%"><div align="right"><img src="imagenes/calendar02.gif" alt="" width="16" height="16" /></div></td>
</tr>
</table>
</div>
<div id="cuerpo_general">
<div class="texto_Negro" id="cuerpo_interior">
<form id="form1" name="form1" method="post" action="index.php"><div align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="4">
<tr>
<td colspan="2"><div align="left"><strong>BUSQUEDA DE PRODUCTOS</strong></div></td>
<td> </td>
<td><div align="left"><strong>Informacion General</strong></div></td>
</tr>
<tr>
<td width="16%"><div align="left">Categoria</div></td>
<td width="28%"><label>
<div align="left">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="72%"><select name="form_categoria" class="texto_Negro" id="form_categoria">
<option value="si" >Ofertas</option>
<?php
//Visulizando el listado del personal
$buscando_cetegorias = mysql_query("select * FROM categorias order by nombre asc");
while($categorias = mysql_fetch_array($buscando_cetegorias)){
?>
<option value="<?php echo $categorias['id_categorias']; ?>" ><?php echo $categorias['nombre']; ?></option>
<?php
}
?>
</select></td>
<td width="28%"><div align="center"><img src="imagenes/serch.gif" width="14" height="14" /></div></td>
</tr>
</table>
</div>
</label></td>
<td width="4%"> </td>
<td width="52%" rowspan="3" align="left" valign="top"><div align="left">En este sistema usted podra encontrar cualquier informaicon de nuestros productos ofrecidos por nuestra emrpesa.</div></td>
</tr>
<tr>
<td><div align="left">Producto</div></td>
<td><div align="left">
<label>
<input name="form_producto" type="text" class="texto_Negro" id="form_producto" size="16" />
</label>
</div></td>
<td> </td>
</tr>
<tr>
<td colspan="2"><div align="right">
<input name="enviado" type="hidden" id="enviado" value="si" />
<input name="button" type="submit" class="texto_Negro" id="button" value="Buscar" />
</div></td>
<td> </td>
</tr>
</table>
</div>
</form>
</div>
<?php
if($enviado == 'si'){
?>
<table width="408" border="1" cellpadding="4" cellspacing="0" bordercolor="#CCCCCC">
<tr>
<td>Busqueda de Productos</td>
</tr>
</table>
<br />
<?
//Cuerpo BUSQUEDA
$buscando_productos = mysql_query("select * FROM productos where nombre like '%$form_producto%' and categoria_id like '%$form_categoria%' order by precio asc");
while($productos = mysql_fetch_array($buscando_productos)){
?>
<table width="408" border="1" cellpadding="4" cellspacing="0" bordercolor="#CCCCCC">
<tr>
<td width="29%">
<?php
if($productos['mime'] == ""){?>
<div align="center">
Sin Imagen
</div>
<?php
}else{
?>
<img src="<?php echo "ver.php?id_imagen=$productos[idproductos]"; ?>">
<?php
}
?>
</td>
<td width="71%"><p> <span class="texto_MiniTitulo"><strong>Producto: <?php echo $productos['nombre']; ?></strong></span><br />
Categoria:
<?php
$buscando_cetegorias2 = mysql_query("select * FROM categorias where id_categorias = '$productos[categoria_id]'");
$categorias2 = mysql_fetch_array($buscando_cetegorias2);
if($categorias2['nombre'] == ""){
echo "Categoria Eliminada";
}else{
echo $categorias2['nombre'];
}
?>
<br />
Informacion: <?php echo $productos['info']; ?><br />
<span class="texto_verde"><strong>
<?php
if($productos['precio'] != 0){
echo "Precio: $ ".$productos['precio'];
}
if($productos['precio'] != 0 && $productos['cantidad'] != 0){
echo " - ";
}
if($productos['cantidad'] != 0){
echo "Cantidad: ".$productos['cantidad'];
}
?></strong></span></p>
</td>
</tr>
</table>
<br />
<?
}
}else{
?>
<table width="408" border="1" cellpadding="4" cellspacing="0" bordercolor="#CCCCCC">
<tr>
<td>Ofertas de Productos</td>
</tr>
</table>
<br />
<?php
//Busqueda de productos
$buscando_productos = mysql_query("select * FROM productos where oferta like '1' and nombre like '%$form_producto%' order by precio asc");
while($productos = mysql_fetch_array($buscando_productos)){
?>
<table width="408" border="1" cellpadding="4" cellspacing="0" bordercolor="#CCCCCC">
<tr>
<td width="29%">
<?php
if($productos['mime'] == ""){?>
<div align="center">
Sin Imagen
</div>
<?php
}else{
?>
<img src="<?php echo "ver.php?id_imagen=$productos[idproductos]"; ?>">
<?php
}
?>
</td>
<td width="71%"><p> <span class="texto_MiniTitulo"><strong>Producto: <?php echo $productos['nombre']; ?></strong></span><br />
Categoria:
<?php
$buscando_cetegorias2 = mysql_query("select * FROM categorias where id_categorias = '$productos[categoria_id]'");
$categorias2 = mysql_fetch_array($buscando_cetegorias2);
if($categorias2['nombre'] == ""){
echo "Categoria Eliminada";
}else{
echo $categorias2['nombre'];
}
?>
<br />
Informacion: <?php echo $productos['info']; ?><br />
<span class="texto_verde">
<strong>
<?php
if($productos['precio'] != 0){
echo "Precio: $ ".$productos['precio'];
}
if($productos['precio'] != 0 && $productos['cantidad'] != 0){
echo " - ";
}
if($productos['cantidad'] != 0){
echo "Cantidad: ".$productos['cantidad'];
}
?>
</strong></span></p>
</td>
</tr>
</table>
<br />
<?
}//fin busqueda de productos
}
?>
<br />
</div>
<?php
mysql_close($link);
?>}
</body>
</html>
leyendo tu codigo, vi varias cosas que me parecen raro, y creo que estan mal echas. primero, cierras y abres mucho el <php y ?>. lo ahces cada cinco segundos. ej:
if($productos['mime'] == ""){?>
<div align="center">
Sin Imagen
</div>
<?php
}else{
?>
<img src="<?php echo "ver.php?id_imagen=$productos[idproductos]"; ?>">
<?php
}
no se si eso da error, pero haci lo que haces es enredar tu codigo, eso se puede cambiar por un
<?php
if($productos['mime'] == ""){
echo '<div align="center">
Sin Imagen
</div>';
}else{
echo '<img src="ver.php?id_imagen=$productos[idproductos]">';
}
haci esta mas sencillo tu codigo de enterder y hasta bien echo. acomodalo y despues nos dices si persiste tu problema.
Bueno la verdad es que lo estoy realizando par un grupo de amigos, y como estan empezando les pidieron de esta clase y ese es el problema, haber plis que me olvide como era la parte de codigo porfavor
<?php
mysql_close($link);
?>}
</body>
</html>
Si te fijas bine ahi tenes un error muy feo, el "{" esá fuera de las etiquetas PHP, lo que quiere decir que tenes un bloque de codigo sin cerrar, por eso te sale un error de parseo. Proba dejamdolo asi:
<?php
mysql_close($link);
}
?>
</body>
</html>
Bueno aver no me di cuenta de ese detalle lo reviso y te comunico gracias....