una bien y una con error 500 que podra ser.. bueno es variable el error pero falla mucho!! esto pasa siempre con php??me pueden echar un vistazo a mi codigo?
Código PHP:
<?php require_once('../Connections/noticias.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO eventos_com (galeria, nombre, correo, fecha, contenido) VALUES (%s, %s, %s, %s, %s)",
GetSQLValueString($_POST['galeria'], "text"),
GetSQLValueString($_POST['nombre'], "text"),
GetSQLValueString($_POST['correo'], "text"),
GetSQLValueString($_POST['fecha'], "text"),
GetSQLValueString($_POST['contenido'], "text"));
mysql_select_db($database_noticias, $noticias);
$Result1 = mysql_query($insertSQL, $noticias) or die(mysql_error());
}
$maxRows_comments = 16;
$pageNum_comments = 0;
if (isset($_GET['pageNum_comments'])) {
$pageNum_comments = $_GET['pageNum_comments'];
}
$startRow_comments = $pageNum_comments * $maxRows_comments;
mysql_select_db($database_noticias, $noticias);
$query_comments = "SELECT * FROM eventos_com WHERE galeria='".$_GET['galeria']."' ORDER BY id DESC";
$query_limit_comments = sprintf("%s LIMIT %d, %d", $query_comments, $startRow_comments, $maxRows_comments);
$comments = mysql_query($query_limit_comments, $noticias) or die(mysql_error());
$row_comments = mysql_fetch_assoc($comments);
if (isset($_GET['totalRows_comments'])) {
$totalRows_comments = $_GET['totalRows_comments'];
} else {
$all_comments = mysql_query($query_comments);
$totalRows_comments = mysql_num_rows($all_comments);
}
$totalPages_comments = ceil($totalRows_comments/$maxRows_comments)-1;
?>
<!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 $_GET['title']; ?></title>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=640,height=490,left = 340,top = 200.5');");
}
// End -->
</script>
<style type="text/css">
<!--
#wrap { margin:0 auto 0 auto; width:680px; }
#wrapo { margin:0 auto 0 auto; width:640px; background-color:#333; height:140px; float:left; }
#wrapa { margin:0 auto 0 auto; width:680px; text-decoration:none; font-size:15px; }
body,td,th {
font-size: 12px;
}
div.flet:first-letter {color:#ff0000;font-size:xx-large; font-family:"Courier New", Courier, monospace}
-->
</style></head>
<body>
<div id="wrap">
<div class="flet" style="font:12px Arial; color:#FFF; display:block; letter-spacing:1px; padding:5px; clear:both; text-align: center;"><?php echo $_GET['title']; ?></div>
</div>
<div style="background:url(../imagenes/fondo_galeria.gif) bottom left no-repeat; width:100%">
<div id="wrap">
<?php include('PHPPaging.lib.php'); ?>
<?php
// Directorio del cuál vamos a extraer las imágenes
$path = $_GET['galeria']."/images";
// Extracción de imágenes. Ver http://www.php.net/readdir
$dh = opendir($path);
$archivos = array();
while (($file = readdir($dh)) !== false) {
if($file != "." && $file != "..") {
if(strtolower(substr($file, -4)) == '.jpg') $archivos[] = $file;
}
}
closedir($dh);
$paging = new PHPPaging;
$paging->agregarArray($archivos);
$paging->porPagina(12);
$paging->paginasAntes(2, 3);
$paging->paginasDespues(2, 3);
$paging->linkSeparadorEspecial(' ... ', true);
$paging->linkTitulo('Página %1$s/%5$s > Imágenes %2$s a %3$s de %4$s', true); // Título de los links
$paging->ejecutar();
$info = $paging->superArray();
?>
<?php
while($datos = $paging->fetchResultado()) {
// Imprimimos
echo '
<div style="width:320px; height:270px; float:left; background-color:#333 "><center><A HREF="javascript:popUp(\'http://www.elcapitolio.com.mx/eventos/'.$path.'/'.$datos.'\')"><img src="http://www.elcapitolio.com.mx/phpThumb/phpThumb.php?src=../eventos/'.$path.'/'.$datos.'&wp=320&hl=240&q=95" border="0px" /></A></center>
<div style="width:100%; background:#333; font-family:Arial, Helvetica, sans-serif; font-size:11px; vertical-align:middle; padding:0px 0px 12px 0px; margin:0px" align="center">
<script>function fbs_click() {u=location.href;t=document.title;window.open(\'http://www.facebook.com/share.php?u=http://www.elcapitolio.com.mx/eventos/'.$path.'/'.$datos.'\',\'sharer\',\'toolbar=0,status=0,width=626,height=436\');return false;}</script>
<a href="http://www.facebook.com/share.php?u=http://www.elcapitolio.com.mx/eventos/'.$path.'/'.$datos.'" target="_blank" class="face"><img src="http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981" border="0px" alt="" /> Publicar esta foto en tu perfil</a>
</div></div>
';
}
?>
</div>
<div id="wrapa" align="center">
<?php echo $paging->fetchNavegacion(); ?>
</div>
</div>
<div style="background:#333;">
<table width="589" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td style="background:url(../imagenes/coment01.jpg)"><img src="../imagenes/coment01.jpg" width="590" height="60" /></td>
</tr>
<tr>
<td style="background:url(../imagenes/coment02.jpg); text-align: center;"><?php
$fechador = $row_comments['fecha'];
$fechador = str_replace("/", "-", $fechador);
setlocale(LC_TIME, 'es_MX');
$fechag = "Publicado el ".strftime('%d de %B del %Y',strtotime($fechador));
?>
<?php do {
if ($row_comments['galeria'] == $_GET['galeria'] ) {
?>
<table width="90%" align="center" cellpadding="4" style="border:dashed #CCC 2px; background:#F3F3F3">
<tr>
<td><div align="left"><?php echo $row_comments['nombre']; ?> - <a href="mailto:<?php echo $row_comments['correo']; ?>"><img src="../chismes/images/mail.gif" width="12" height="10" border="0" alt="<?php echo $row_comments['correo']; ?>" /></a></div>
<div align="left" style="font-family:Arial, Helvetica, sans-serif; font-size:9px;"><?php echo $fechag ?></div>
<div align="left" class="flet" style="font-family:Arial, Helvetica, sans-serif; font-size:12px; padding-top:8px; margin-top:4px; border-top:dashed 1px #333;"><?php echo $row_comments['contenido']; ?></div></td>
</tr>
</table>
<br />
<?php }
} while ($row_comments = mysql_fetch_assoc($comments)); ?>
<form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">
<table align="center">
<tr valign="baseline">
<td align="right" nowrap="nowrap"><input type="text" name="nombre" value="Nombre" size="50" onfocus="this.value=''" style="border:dashed #CCC 2px; background:#F3F3F3; font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#333;" /></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap="nowrap"><input type="text" name="correo" value="Correo" size="50" onfocus="this.value=''" style="border:dashed #CCC 2px; background:#F3F3F3; font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#333;" /></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap="nowrap"><textarea name="contenido" cols="52" rows="3" style="border:dashed #CCC 2px; background:#F3F3F3; font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#333;" onfocus="this.value=''">Mensaje</textarea></td>
</tr>
<tr valign="baseline">
<td align="center" nowrap="nowrap"><input type="submit" value="Enviar Comentario" style="border:dashed #CCC 2px; background:#F3F3F3" /></td>
</tr>
</table>
<input type="hidden" name="galeria" value="<?php echo $_GET['galeria'] ?>" />
<input type="hidden" name="fecha" value="<? echo date("Y-m-d") ?>" />
<input type="hidden" name="MM_insert" value="form1" />
</form>
</td>
</tr>
<tr>
<td><img src="../imagenes/coment03.jpg" width="589" height="47" /></td>
</tr>
</table>
</div>
</body>
</html>
<?php
mysql_free_result($comments);
?>