Ver Mensaje Individual
  #7 (permalink)  
Antiguo 17/09/2003, 15:06
davineitor
 
Fecha de Ingreso: septiembre-2003
Ubicación: Chile
Mensajes: 30
Antigüedad: 20 años, 7 meses
Puntos: 0
ME RESULTO!!

ME RESULTO ESTE ES EL CODIGO:
Código:
                      <? 
// Datos de conexión a la base 
$base="BASE"; 
$con=mysql_connect("HOST","BASE","PASS"); 
mysql_select_db($base,$con); 

if (!isset($pg)) 
$pg = 0; // $pg es la pagina actual 
$cantidad=5; // cantidad de resultados por página 
$inicial = $pg * $cantidad; 

$pegar = "SELECT * FROM usuarios where sexo='Mujer' ORDER BY nick LIMIT $inicial,$cantidad"; 
$cad = mysql_db_query($base,$pegar) or die (mysql_error()); 

$contar = "SELECT * FROM usuarios where sexo='Mujer' ORDER BY nick"; 
$contarok= mysql_db_query($base,$contar); 
$total_records = mysql_num_rows($contarok); 
$pages = intval($total_records / $cantidad); 

 while($row = mysql_fetch_array($cad)) { 
 $nick = $row[nick];
 $sexo = $row[sexo];
 $edad = $row[edad];
 $ciudad = $row[ciudad];
 $msn = $row[msn];
 $nombre = $row[nombre];
 $apellidos = $row[apellidos];
 $email = $row[email];
 $foto = $row[foto];
 
$filename = "lista.htm";
 $fd = fopen ($filename, "r");
 $file= fread ($fd, filesize ($filename));
 $file = str_replace("{NICK}", "$nick", $file);
 $file = str_replace("{CIUDAD}", "$ciudad", $file);
 $file = str_replace("{SEXO}", "$sexo", $file);
 $file = str_replace("{EDAD}", "$edad", $file);
 $file = str_replace("{NOMBRE}", "$nombre", $file);
 $file = str_replace("{APELLIDO}", "$apellidos", $file);
 $file = str_replace("{FOTO}", "$foto", $file);
 $file = str_replace("{EMAIL}", "$email", $file);
 print $file;
 print "<br>";
 }
// Cerramos la conexión a la base 
$con=mysql_close($con); 

// Creando los enlaces de paginación 
echo "<p>"; 
if ($pg <> 0) 
{ 
$url = $pg - 1; 
echo "<a href='mujeres.php?pg=".$url."'>&laquo; Anterior</a>&nbsp;"; 
} 
else { 
echo " "; 
} 

for ($i = 0; $i<($pages + 1); $i++) { 
if ($i == $pg) { 
echo "<font face=Arial size=2 color=ff0000><b>&nbsp;$i&nbsp;</b></font>"; 
} 
else { 
echo "<a href='mujeres.php?pg=".$i."'>".$i."</a>&nbsp;"; 
} 
} 

if ($pg < $pages) { 
$url = $pg + 1; 
echo "<a href='mujeres.php?pg=".$url."'>Siguiente &raquo;</a>"; 
} 
else { 
echo " "; 
} 
echo "</p>"; 
?>
ESTUVE
ESTUVE DIAS PENSANDO HASTA Q ME RESULTO!