hola a todos, como estan? Bueno escribo este post x q tengo una pagina y no me quiere funcionar...Me salen unos errores, esperon que me ayuden!!! aqui esta el codigo de mi pagina completo:
index.php
<?php
@error_reporting(0);
if (!file_exists('configxxx.php'))
{
# aun no se instalado
header("Location: ./instalar/");
die();
exit;
}
@include_once "configxxx.php";
/* Conseguir Metatags */
$query2 = mysql_query("SELECT * FROM `".$fijo."_configuraciones` WHERE titulo = 'titulon2' LIMIT 1");
$title = mysql_fetch_array($query2);
$titulo = $title['valor'];
unset($query2,$title);
$query = mysql_query("SELECT * FROM `".$fijo."_configuraciones` WHERE titulo = 'descripcion' LIMIT 1");
$description = mysql_fetch_array($query);
$descripcion = $description['valor'];
unset($query,$description );
$query1 = mysql_query("SELECT * FROM `".$fijo."_configuraciones` WHERE titulo = 'tags' LIMIT 1");
$keywords = mysql_fetch_array($query1);
$tag = $keywords['valor'];
unset($query1,$keywords );
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es">
<head>
<meta http-equiv="Pragma" content="no-cache" />
<META HTTP-EQUIV="Content-Language" CONTENT="es">
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' />
<meta name="description" content="<? echo $descripcion; ?>">
<meta name="title" content="<?php echo .$titulo.; ?>">
<meta name="author" CONTENT="info@neopuertaxxx.com">
<meta name="robots" content="index,follow" />
<meta name="Subject" CONTENT="NeoPuertaXxx.com">
<meta name="Language" CONTENT="espanish">
<link rel="alternate" type="application/rss+xml" title="Nuevos videos en NeoPuertaXxx.com" href="./rss/rss.php" />
<METa name="keywords" content="<? echo .$tag.; ?>">
<META NAME="revisit-after" CONTENT="2 days">
<META NAME="distribution" CONTENT="Global">
<META NAME="Copyright" CONTENT="Copyright 2011 NeoPuertaXxx.com, Inc">
<meta name="rating" content="General" />
<meta name="classification" content="*" />
<meta name="locality" content="Anzoategui, El Tigre, Venezuela">
<LINK rel="shortcut icon" href="favicon.ico">
<link rel='StyleSheet' href='./estilo/Default.css'
title="Default" media='all' />
<link rel="stylesheet" type="text/css" href="./estilo/Css.css" title="Css" />
<script type='text/javascript' language='javascript' src='./js/jquery.js'></script>
<script type='text/javascript' language='javascript' src='./js/img.js'></script>
<script type='text/javascript' language='javascript' src='./js/js.js'></script>
<title><?php echo .$titulo.; ?></title>
</head>
<body>
<a href="./">
<img align="center" src=".\imagenes\logo.png" width="610" height="125" alt="NeoPuertaXxx.com" border="0" />
</a>
<?
@include_once "./estilo/menu.html";
?>
<table border="0" cellspacing="4" width="838">
<tr valign="top">
<td>
<?
@include_once "./include/menu.php";
?>
<td valign="top">
<table cellpadding="5" style="border: #DB00aF 2px solid;" width="658px">
<tr valign="top">
<td style="background-color:white" height="2800px">
<?
if($page == "") :
@include_once("configxxx.php");
@include_once("./include/principal.php");
else :
if(file_exists("$page.php")) :
$page = htmlspecialchars(trim($_GET["page"]));
$page = eregi_replace("<[^>]*>","",$page) ;
$page = eregi_replace(".*//","",$page) ;
$page = str_replace("http://","",$page) ;
$page = str_replace("www","",$page) ;
$page = str_replace("https://","",$page) ;
if (is_file(dirname(__FILE__) . '/module/'. $page .'.php'))
:
require_once(dirname(__FILE__) . '/module/'. $page .'.php');
else:
echo "<script>location='error404.php'</script>" ;
endif;
?>
</td>
</tr>
</table>
<br />
<center>
<?php
@include_once "configxxx.php";
/* Conseguir Copyright */
$sql = mysql_query("SELECT * FROM `".$fijo."_configuraciones` WHERE titulo = 'copyright' LIMIT 1");
$Copy = mysql_fetch_array($sql);
$copyright = $Copy['valor'];
unset($sql,$Copy);
echo .$copyright. ;
?>
</center>
</body>
</html>
video.php
<?php
@error_reporting(0);
@include_once "configxxx.php";
/* Conseguir Metatags */
$query2 = mysql_query("SELECT * FROM `".$fijo."_configuraciones` WHERE titulo = 'titulon' LIMIT 1");
$title = mysql_fetch_array($query2);
$titulo = $title['valor'];
unset($query2,$title);
$query1 = mysql_query("SELECT * FROM `".$fijo."_configuraciones` WHERE titulo = 'tags' LIMIT 1");
$keywords = mysql_fetch_array($query1);
$tag = $keywords['valor'];
unset($query1,$keywords );
mysql_query("update `".$fijo."_configuraciones` set valor=valor+1 where titulo='vistas'") ;
$id = $_GET['id'];
mysql_query("update `".$fijo."_video` set lectura=lectura+1 where id=.$id.") ;
$query2 = mysql_query("SELECT * FROM `".$fijo."_video` WHERE id = .$id. LIMIT 1");
$Nombrevideo = mysql_fetch_array($query2);
$nombre = ucfirst($Nombrevideo['titulo']);
unset($query2,$Nombrevideo );
$imagesql = mysql_query("SELECT * FROM `".$fijo."_video` WHERE id = .$id. LIMIT 1");
$Image = mysql_fetch_array($imagesql);
$imagen = $Image['imagen'];
unset($imagesql,$Image );
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es">
<head>
<meta http-equiv="Pragma" content="no-cache" />
<META HTTP-EQUIV="Content-Language" CONTENT="es">
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' />
<meta name="description" content="Aqui les traigo un video de <? echo .$nombre. ; ?>, que seguro que no vas a dejar de ver...">
<meta name="title" content="<?php echo .$titulo. ; ?> - <?php echo .$nombre. ; ?>">
<meta name="author" CONTENT="info@neopuertaxxx.com">
<meta name="robots" content="index,nofollow" />
<meta name="Subject" CONTENT="NeoPuertaXxx.com">
<meta name="Language" CONTENT="espanish">
<link rel="alternate" type="application/rss+xml" title="Nuevos videos en NeoPuertaXxx.com" href="./rss/rss.php" />
<METa name="keywords" content="<? echo .$tag. ; ?>">
<META NAME="revisit-after" CONTENT="2 days">
<META NAME="distribution" CONTENT="Global">
<META NAME="Copyright" CONTENT="Copyright 2011 NeoPuertaXxx.com, Inc">
<meta name="rating" content="General" />
<meta name="classification" content="*" />
<link rel="image_src" href="<? echo .$imagen. ; ?>" />
<meta name="locality" content="Anzoategui, El Tigre, Venezuela">
<LINK rel="shortcut icon" href="favicon.ico">
<link rel='StyleSheet' href='./estilo/Default.css'
title="Default" media='all' />
<link rel="stylesheet" type="text/css" href="./estilo/Css.css" title="Css" />
<script type='text/javascript' language='javascript' src='./js/jquery.js'></script>
<script type='text/javascript' language='javascript' src='./js/img.js'></script>
<script type='text/javascript' language='javascript' src='./js/js.js'></script>
<title><?php echo .$titulo. ; ?> - <?php echo .$nombre. ; ?></title>
<script type='text/javascript'>
function ValidateComent(form) {
if (form.autor.value=="") {
alert('Debes ingresar un Nombre') ;
return false;
}
if (form.email.value=="") {
alert('Debes de ingresar tu E-Mail') ;
return false;
}
if (form.mensaje.value=="") {
alert('Por favor introduce tu Comentario') ;
return false;
}
if (form.mensaje.value.length > 260) {
alert('Tu Comentario supera los 260 caractéres.') ;
return false;
}
}
</script>
</head>
<body>
<a href="./">
<img align="center" src="./imagenes/logo.png" width="610" height="125" alt="NeoPuertaXxx.com" border="0" />
</a>
<?
@include_once "./estilo/menu.html";
?>
<table border="0" cellspacing="4" width="838">
<tr valign="top">
<td>
<?
@include_once "./include/menu.php";
?>
<td valign="top">
<table cellpadding="5" style="border: #DB00aF 2px solid;" width="658px">
<tr valign="top">
<td style="background-color:white" height="2800px">
<?php
@include_once "configxxx.php";
$Nom = mysql_query("SELECT * FROM `".$fijo."_video` WHERE id = '$id' LIMIT 1");
$Nombrevideo = mysql_fetch_array($Nom);
$nombre = ucfirst($Nombrevideo['titulo']);
unset($Nom,$Nombrevideo );
?>
<h1 align="center"><? echo .$nombre. ; ?> - Video</h1>
<br>
<center>
<a href="http://www.youtube.com" target="_blank">
<IMG border="0" src="youtube.gif" width="475" height="80"></a></center><br>
<table align="right">
<?php
$mysql1 = mysql_query("SELECT * FROM `".$fijo."_configuraciones` WHERE titulo = 'redes' LIMIT 1");
$Red = mysql_fetch_array($mysql1);
$redes = $Red['valor'];
unset($mysql1,$Red );
echo .$redes.;
?>
</table>
<br><br>
<?php
$id = $_GET['id'];
$query2 = mysql_query("SELECT * FROM `".$fijo."_video` WHERE id = '$id' limit 1");
$a = 0;
while ($VIDEO = mysql_fetch_array($query2)) :
$a++;
echo"<p align='center'>
.$VIDEO['video']. </p> <p align='center'>
<a href='#error' onClick='window.open('error.php?erroneo=.$id.','popup','width=600,height=400,scrollbars=yes')" onmouseout="window.status='''
onmouseover='window.status='Este video no funciona';return true'>
¿El video no funciona? <b>Reportar error.</b></a><p />
<br>
<p align='center'><b>Duracion:</b>
.$VIDEO['duracion']. Minutos | <b>Reproduciones:</b> .$VIDEO['lectura']. | <b>Categoría:</b>
.$VIDEO['categoria']. | <b>Subcategoría:</b> .$VIDEO['subcategoria']. | <b>Votos:</b> .$VIDEO['voto'].
</p>";
?>
<p align='center'>
<iframe
src='http://www.facebook.com/plugins/like.php?href=video.php?id=
<? echo .$id. ; ?>'
scrolling='no' frameborder='0'
style='border:none; width:370px; height:26px'></iframe>
<p />
<?php
if ($a == 0) :
echo "<b>No se encontro video</b>";
endif;
@include_once "configxxx.php";
$id = htmlentities( $_GET['id'] );
$resp = mysql_query("SELECT videoid FROM `".$fijo."_comentarios` WHERE videoid = '$id' ");
$totalcomentarios = mysql_num_rows($resp) ;
mysql_free_result($resp) ;
echo " <b>Total Comentarios:<b /> .$totalcomentarios.<br><br> ";
$resultComen = mysql_query("SELECT * FROM `".$fijo."_comentarios` WHERE videoid = '$id' order by id desc limit 8");
$b = 0;
while ($rowComen = mysql_fetch_array($resultComen)) :
$b++;
?>
<table cellpadding="4" cellspacing="1" align="center" class="tabla">
<tr>
<td class="filatitulo">
<?php
$autor = ucfirst(utf8_decode($rowComen['autor'])) ;
echo .$autor. ;
?>
</td>
</tr>
<tr>
<td class="filacentro">
<?php
$comentario = preg_replace("/(?<!<a href=\")((http|ftp)+(s)?:\/\/[^<>\s]+)/i","<a href=\"\\0\" target=\"_blank\" rel=\"nofollow\">\\0</a>",$comentario) ;
$comentario = ucfirst(utf8_decode($rowComen['comentario'])) ;
echo .$comentario. ;
?>
</td>
</tr>
<tr>
<td class="filaabajo">
Fecha :
<? echo .$rowComen['fecha']. ; ?>
</td>
</tr>
</table>
<br>
<?php
if ($b == 0) :
echo "<b>No hay Comentarios</b>";
endif;
?>
<table style="border: 2px dashed rgb(255, 0, 255);" align="center" width="45%">
<tbody>
<tr>
<td class="snote">
<p align="center">
<form action="./form/EnviarComentario.php" name="form" method="post" onsubmit='return ValidateComent(form)'>
<p align="center">
<b><label for="autor"><font color="red">*</font>Nombre</ label><b />
<br />
<input type="text" name="autor" id="autor" class="form" title="Ingresa tu Nombre o Nick" size="30" /><br />
<b><label for="email"><font color="red">*</font>E-Mail</label><b />
<br />
<input type="text" name="email" id="email" class="form" title="Ingresa tu Email" size="30" />
<br />
<b><label for="mensaje">
<?
@include_once "./include/editor.html";
?>
<br />
<textarea name="mensaje" id="mensaje" cols="30" rows="8" class="form" title="Ingresa tu Comentario"></textarea><br />
<p align="center">
<input type="submit" class="form" value="Enviar" title="Enviar Comentario" name="submit" />
</form>
</p>
</td></tr></tbody></table>
<br><br>
<h1 align="light">Videos Relacionados<h1 /><br>
<?
@include_once "configxxx.php";
$id = htmlentities($_GET['id'];)
$sql3 = mysql_query("SELECT * FROM `".$fijo."_video` WHERE id = .$id. LIMIT 1");
$relacionados1 = mysql_fetch_array($sql3);
$relacionados = $relacionados1['titulo'];
unset($sql3,$relacionados1 );
$sql2 = mysql_query("SELECT * FROM `".$fijo."_video` WHERE titulo LIKE '%".$relaciondos."%' ORDER BY RAND() limit 4");
$d = 0;
while ($row = mysql_fetch_array($sql2)) :
$d++;
?>
<DIV style="FLOAT: left; MARGIN-RIGHT: 5px" id="videos">
<DIV id="videos1">
<DIV id="img"><A
href="video.php?id=<? echo .$row['id'].; ?>">
<IMG id="<? echo .$row['id'].; ?> "
src="<? echo .$row['imagen'].; ?>" title="<?
$titulo = ucfirst(utf8_decode($row['titulo']));
echo .$titulo.;
?>" width="180" height="135" border="0"></A>
</DIV>
<DIV id="nombrevideo">
<TABLE width="180" height="40">
<TBODY>
<TR>
<TD align=middle><B>
<A href="video.php?id=<? echo .$row['id'].; ?>">
<? echo .$row['titulo'].; ?></A>
</B></TD></TD></TR></TBODY></TABLE></DIV>
<DIV id="dur">
<TABLE width="180" height="30">
<TBODY>
<TR>
<TD height="30" align="middle"><FONT size="-2"><? echo .$titulo.; ?> Minutos </FONT></TD></TD></TR></TBODY></TABLE></DIV></DIV></DIV>
<?php
if ($d == 0) :
echo"<b>No hay videos relacionados</b>";
endif;
?>
</td>
</tr>
</table>
<br />
<center>
<?php
@include_once "configxxx.php";
/* Conseguir Copyright */
$query2 = mysql_query("SELECT * FROM `".$fijo."_configuraciones` WHERE titulo = 'copyright' LIMIT 1");
$Copy = mysql_fetch_array($query2);
$copyright = $Copy['valor'];
unset($query2,$Copy);
echo .$copyright. ;
?>
</center>
</body>
</html>
él error que me sale es este:
Parse error: syntax error, unexpected $end
Sí señalaras la linea exacta donde te da el error seria mas sencillo, no pude localizarla, por otro lado hasta donde entiendo lo de parse puede ser debido al tipo de dato que manejas o como lo estas manejando.
Saludos
cuando sale ese mensaje el problema esta en que hay una llave mal cerrada es decir tienes un { y no tienes su correspondiente }, por eso habla de $end, en las siguientes lineas de codigo tienes te flata un end if:
asi lo tienes tu:
if($page == "") :
@include_once("configxxx.php");
@include_once("./include/principal.php");
else :
if(file_exists("$page.php")) :
$page = htmlspecialchars(trim($_GET["page"]));
$page = eregi_replace("<[^>]*>","",$page) ;
$page = eregi_replace(".*//","",$page) ;
$page = str_replace("http://","",$page) ;
$page = str_replace("www","",$page) ;
$page = str_replace("https://","",$page) ;
if (is_file(dirname(__FILE__) . '/module/'. $page .'.php'))
:
require_once(dirname(__FILE__) . '/module/'. $page .'.php');
else:
echo "<script>location='error404.php'</script>" ;
endif;
asi deberia ir.
if($page == "") :
@include_once("configxxx.php");
@include_once("./include/principal.php");
else :
if(file_exists("$page.php")) :
$page = htmlspecialchars(trim($_GET["page"]));
$page = eregi_replace("<[^>]*>","",$page) ;
$page = eregi_replace(".*//","",$page) ;
$page = str_replace("http://","",$page) ;
$page = str_replace("www","",$page) ;
$page = str_replace("https://","",$page) ;
if (is_file(dirname(__FILE__) . '/module/'. $page .'.php')):
require_once(dirname(__FILE__) . '/module/'. $page .'.php');
else:
echo "<script>location='error404.php'</script>" ;
endif;
endif;
avisa si sigues teniendo el error
el error persiste...me dice que esta en la ultima linea!
veo que tambien usas while(): pero en ninguna parte de tu documento veo el respectivo endwhile; identa tu texto para que conseguir ese tipo de errores sea facil, si quieres hacer un while de una sola linea quitale los dos puntos no hacen falta.
te dare un consejo... quita esto hasta que funcione ;)
error_reporting(0);
En el archivo video.php, en la ultima linea:
echo .$copyright. ;
Fijate que antes y despues de la variable $copyright tenés un punto de concatenacion, cambia esa linea para que quede así:
echo $copyright;
Y nos contas.
unexpected $end
Significa que no se epsera el fin del script, eso e porque te faltaria la variable para concatenar. ese es el error..
Saludos
ok gracias a todos....voy revisar a ver si me funciona bien y despues le digo.