Código:
Haber si me ayudais porque el erro lo tengo en crear los enlaces del paginador no se cmo debo hacerlo, la seccion se llama verhd pero apartir de ahi no se como hacerlo como enviar la variable...kreo k el criterio de la consulta debo ponerlo con una variable<p> <? //Limito la busqueda $TAMANO_PAGINA = 1; //examino la página a mostrar y el inicio del registro a mostrar $pagina = $_GET["pagina"]; if (!$pagina) { $inicio = 0; $pagina=1; } else { $inicio = ($pagina - 1) * $TAMANO_PAGINA; } $ssql = "select * from torrents_descargas where estado='1' and calidad= 'HD Rip'order by id DESC"; $rs = mysql_query($ssql,$conectar); $num_total_registros = mysql_num_rows($rs); //calculo el total de páginas $total_paginas = ceil($num_total_registros / $TAMANO_PAGINA); //pongo el número de registros total, el tamaño de página y la página que se muestra echo "Número de registros encontrados: " . $num_total_registros . "<br>"; echo "Se muestran páginas de " . $TAMANO_PAGINA . " registros cada una<br>"; echo "Mostrando la página " . $pagina . " de " . $total_paginas . "<p>"; $tt = mysql_query("select * from torrents_descargas where estado='1' and calidad= 'HD Rip'order by id DESC limit $inicio,$TAMANO_PAGINA"); while($datostt = mysql_fetch_array($tt)) { $tituloenlace4 = str_replace(" ", "_", str_replace("ú", "u", str_replace("ó", "o", str_replace("í", "i", str_replace("é", "e", str_replace("á", "a", str_replace(".", "_", $datostt[titulo]))))))); if(strlen($datostt[titulo]) > "70") { $datostt[titulo] = substr($datostt[titulo],0,70).".."; } ?> <table border="0" width="438" cellspacing="0" cellpadding="0" id="table2"> <tr> <td bgcolor="#FFFFFF" width="438" height="60" background="imagenes/diseno/hda.gif"> <p align="center"> <b><? echo $datostt[titulo]; ?></b></td> </tr> <tr> <td bgcolor="#FFFFFF" width="438" height="60" background="imagenes/diseno/hdm.gif"> <table border="0" width="440" cellspacing="0" cellpadding="0" id="table3"> <tr> <td width="19"> </td> <td width="105"><font color="#000000"> <img src="imagenes/caratulas/<? echo''.$datostt[imagen].'';?>"width="90" height="130""></a></font></td> <td valign="top"> <?php echo $datostt[comentario] = substr($datostt[comentario],0,450)."...";?><br> <a href="verficha-<? echo''.$datostt[id].'-'.$datostt[titulo].'';?>.html"><img src="imagenes/diseno/verfhd.gif" border="0"> </td> <td width="20"> </td> </tr> </table> </td> </tr> <tr> <td bgcolor="#FFFFFF" background="imagenes/diseno/hdb.gif" width="438" height="60"> <table border="0" width="398" cellspacing="0" cellpadding="0" id="table4"> <tr> <td width="18"> </td> <td width="113"> <p align="center"> <b><? $cogecat = mysql_query("select * from torrents_categorias where $datostt[categoria] = id "); $datoscat = mysql_fetch_array($cogecat); echo $datoscat[nombre] = substr ($datoscat[nombre],0,30) ; ?></b></td> <td width="11"> </td> <td width="23"> </td> <td> </td> <td width="48"> <b><? echo $datostt[ano]; ?></b></td> </tr> </table> </td> </tr> </table><? } ?> <? //muestro los distintos índices de las páginas, si es que hay varias páginas if ($total_paginas > 1){ for ($i=1;$i<=$total_paginas;$i++){ if ($pagina == $i) //si muestro el índice de la página actual, no coloco enlace echo $pagina . " "; else //si el índice no corresponde con la página mostrada actualmente, coloco el enlace para ir a esa página echo "<a href='index.php?seccion=verhd" . $i . "&criterio=" . $txt_criterio . "'>" . $i . "</a> "; } } ?>
bueno graicias a todos de antemano y haber si alguien me modifica el codigo para que funcione...
saludos y gracias por hacer este gran foro