Hola a tod@s!
Seguramente no es la mejor manera de describir mi problema con el título, así que ahora me explico.
Llevo toda la tarde reprogramando una web que hice yo hace un tiempo. He pasado varias veces variables a un archivo a través de include y todo perfecto, pero llevo una hora y media atascado en una página web. La variable funciona correctamente, pero no llega a entrar dentro del archivo al que llamo a través del include. Ya no se que probar. Seguramente necesite un descanso, pero necesito resolver el problema cuanto antes. Os cuento:
Archivo index.php?id=13
Código:
<?php
include("config.php");
include("inc/conexiobd.php");
$link=Conectarse();
if (is_int((int)$_GET["event1"])) {
$event=(int)$_GET["event1"];
$comprovacio=mysql_query("select count(EveID) as NumRegistres, EveEventTancat from EVENT where EveID=".$event,$link);
$comprovacior = mysql_fetch_array($comprovacio);
if ($comprovacior["NumRegistres"]!=1) {
header("Location: error.php");
exit;
}
if ($comprovacior["EveEventTancat"]==0) {
if ($_GET["preview"]!=1) {
header("Location: error.php");
exit;
}
}
}else{
header("Location: error.php");
exit;
}
$temps=mysql_query("select count(VIDID) as TotalVideos, SEC_TO_TIME(SUM(TIME_TO_SEC(VIDDURADA))) as TempsTotal from VIDEO where EveID=".$event,$link);
$rowt = mysql_fetch_array($temps);
$metatitol=$row["EveNom"];
$metadesc="";
$metakey="";
$meta=$row["EveDescripcio"];
include($dir_includes . "html-head.php");
?>
</head>
<body>
<?php
include($dir_includes . "log-visites.php");
include($dir_includes . "header.php");
?>
<div id="container-body">
<div id="body-content">
<div class="clear"></div>
<div class="user-header">
<?
include($dir_includes . "block-llista-header-event.php");
?>
</div>
<div class="clear-none"></div>
<div class="hr" style="margin-bottom: 0pt;"></div>
<div class="clear"></div>
<div class="clear"></div>
<div class="hr" style="margin: 0pt;"></div>
<div class="curved-box-css3">
<div id="Desc" style="width:670px;"><?php $row["EveDescripcio"] ?></div>
</div>
<div class="hr" style="margin-bottom: 0pt; margin-left:20px; position:relative; top:4px; width:690px;" align="center"></div>
<?php
include($dir_includes . "block-events.php");
?>
</div>
<?php
include($dir_includes . "block-videos-relacionats-aleatoris.php");
?>
</div>
<div class="clear-large"></div>
<div class="clear-large"></div>
<?php
include($dir_includes . "footer.php");
?>
</body>
</html>
Archivo block-llista-header-event.php:
Código:
<?php
include("conexiobd.php");
$link=Conectarse();
$revent=mysql_query("select EveID, EveNom, EveDescripcio, date_format(EveData, '%d-%m-%Y') as EveData, EveLocalitzacio, EveLocalitzacioUrl, EveCiutat, EvePais from EVENT where EveID=".$event,$link);
$row = mysql_fetch_array($revent);
?>
<div class="avatar" style="height: 50px;">
<img src="images/avatar.jpg" alt="Logo vídeo" />
</div>
<div class="float-left" style="margin-top: 9px; margin-left: 10px; width:540px;">
<h5 style="margin-top: 0px;">
<?php
$countVid=mysql_query("select count(VidID) as CountVid from VIDEO where EveID=".$event,$link);
$rowc = mysql_fetch_array($countVid);
echo "<span class=\"titolblanc\">".$row["EveNom"]."</span>";
?>
</h5>
<span id="audience-switch" class="float-left" style="margin-left:1px;">
<a href="<?php echo $row["EveLocalitzacioUrl"] ?>" class="function" target="_blank" title="Enlace a Google Maps (ventana nueva)"><?php echo $row["EveLocalitzacio"] ?></a> -
<?php echo $row["EveCiutat"] . ", " .$row["EvePais"] ?>
</span>
<span class="float-left"><?php echo " | " . $row["EveData"] ?></span>
</div>
<div class="float-left entity-nav" style="margin-top:2px;">
<a class="selected" href="event.php?event=<?php echo $row["EveID"] ?>">
<img class="no-border" src="images/videos.png" style="margin-bottom: 2px;" alt="Número de vídeos del evento" title="Número de vídeos del evento" />
</a>
<br />
<a class="selected" href="event.php?event=<?php echo $row["EveID"] ?>" title="Número de videos"><?php echo $rowt["TotalVideos"] ?> Videos</a>
</div>
<div class="float-right entity-nav" style="margin-top:2px;">
<a class="selected" href="event.php?event=<?php echo $row["EveID"] ?>">
<img class="no-border" src="images/rellotge.png" style="margin-bottom: 2px;" alt="Duración total del evento" title="Duración total del evento" />
</a>
<br />
<a class="selected" href="event.php?event=<?php echo $row["EveID"] ?>" title="Duración total de los videos">
<?php
if ($rowt["TempsTotal"]=="") {
echo "00:00:00";
}else{
echo $rowt["TempsTotal"];
}
?>
</a>
</div>
Os he pasado el código de una de las páginas en las que me no pasa la variable, pero me sucede lo mismo en otras 2 páginas.
Ya no se que probar, lo que creo que pueda ser es que esa variable sirve para hacer una consulta a la BB.DD. MySQL, ya que en las otras páginas que he pasado variables funcionaban bien y no tenían consultas.
Un saludo, muchas gracias.