Ver Mensaje Individual
  #7 (permalink)  
Antiguo 16/08/2010, 10:33
memoone
 
Fecha de Ingreso: agosto-2010
Mensajes: 5
Antigüedad: 13 años, 8 meses
Puntos: 0
Respuesta: paginacion php

muchas gracias a todos de verdad que sus aportes han sido de gran ayuda para mi, desidi por usar el phppaging y me va bien, ahora mi problema esta que me muestra solo la pagina principal de la consulta y tambien me mutra los numeros de los links de resultados pero cuando le doy en la pagina dos o link dos no me pasa la variable de la busqueda asi que no aparece nada en la pagina dos solo aparece que no paso la variable de busqueda este es mi nuevo codigo


<?php

//Incluyo el archivo de sesion para impedir el acceso no autorizado a esta página.
require('sesion.php');
require_once 'PHPPaging.lib.php';



?>


<!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>Untitled Document</title>
<style type="text/css">
<!--
.style2 {
font-size: 36px;
color: #000000;
font-weight: bold;
}
.style3 {font-size: 24px}
.style5 {
font-size: 24px;
color: #0000CC;
font-weight: bold;
}
-->
</style>
</head>

<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="66%"><div align="left"><img src="http://www.forosdelweb.com/logo..png" width="404" height="140" alt="logo" /> </div></td>
<td width="34%">&nbsp;</td>
</tr>
<tr>
<td colspan="2" align="right">

</td>
</tr>
<tr>
<td colspan="2" align="right"><form id="form1" name="form1" method="post" action="">
<a href="admin.php"> volver </a>
</form></td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td colspan="2">Listado de fotografias agregadas:</td>
</tr>
<tr>
<td colspan="2">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<?php


$link = mysql_connect('localhost', 'root', '');
mysql_select_db('photogallery', $link);
$paging = new PHPPaging($link);



$busqueda=$_GET['busqueda'];




if(isset($_GET['busqueda']) && $_GET['busqueda'] == 'busqueda');


else




$paging->agregarConsulta ("SELECT * FROM photos WHERE photos.nombred='".$_GET['busqueda']."'" );

$paging->mantenerVar('tipo');

$paging->ejecutar();




$cont = 0;



while($row =$datos = $paging->fetchResultado())


{



$cont++;

$ruta = explode("/",$row[1]);
if($cont%2 != 0) $color = ' bgcolor="#F0F7FF"';
else $color = '';
echo ' <tr'.$color.'>
<td align="center">';


if(file_exists('../images/bolGallery/thumbnail_'.$ruta[count($ruta)-1]))
echo '<img src="http://www.forosdelweb.com/f18/images/bolGallery/thumbnail_'.$ruta[count($ruta)-1].'" />';



else
echo "Todavia no hay vista previa generada para esta foto.";

echo '</td>
<td>Mas Información <b><a href="info_photo.php?id_photo='.$row[0].'">'.$row['nombred'].' '.$row['apellidosd'].' Codigo '.$row['0'].'</a></td>
<td>Vista: '.$row[2]. ' veces</td>
<td><form id="form2" name="form2" method="post" action="">
<input type="submit" name="eliminar" id="eliminar" value="Eliminar" onClick="return confirm(\'Estas seguro que quieres eliminar '.$row[1].'??\')"/>
<input type="hidden" name="id" value="'.$row[0].'" />




</form>
</td>
</tr>';



}

$links = $paging->fetchNavegacion();

echo $links;
?>

</table> </td>
</tr>
</table>


</body>
</html>