Ver Mensaje Individual
  #5 (permalink)  
Antiguo 21/08/2013, 11:47
santi2892009
 
Fecha de Ingreso: mayo-2012
Mensajes: 363
Antigüedad: 12 años
Puntos: 0
Respuesta: perfil de usuario atraves de un enlace

ranking.php(donde estaria los diferentes enlaces );

<?php
session_start();
if(!isset($_SESSION['usuario']))
{
header("Location: index.php");
}
else
{
$us = $_SESSION['usuario'];
require('seguridad.php');
conectar_base_datos();
$consulta = mysql_query("SELECT * FROM usuarios WHERE usuario = '$us'");
$row = mysql_fetch_array($consulta);
echo "Bienvenido: <b>$row[7]</b>";
}
?>
<html>
<head><title>Ranking de Jugadores</title>
</head>
<body>
<?php
if(!isset($_GET['pag']))
{
$pag = 1;
}
else
{
$pag = $_GET['pag'];
}

$registrosPagina = 15;
if($pag == 1)
{
$listaInicio = 0;
}
else
{
$listaInicio = $registrosPagina * ($pag - 1);
}
$ti1 = microtime();
$result = mysql_query("SELECT * FROM usuarios ORDER BY dinero DESC LIMIT $listaInicio, $registrosPagina");
$ti2 = microtime();
$tot = $ti2 - $ti1;
echo $tot;
echo "<center><h2>Ranking de Jugadores</h2></center>";
echo "<table align='center' border='0'><tr><td><b>Lugar</b></td><td><b>Jugador</b></td><td><b>Dinero</b></td></tr>";

$lugar = ($pag * $registrosPagina) - $registrosPagina;

while($rs = mysql_fetch_array($result))
{
$lugar += 1;
echo "<tr><td>$lugar</td><td><a href='perfil_nuevo.php?jug=$rs[5]'>$rs[7]</a></td><td>$rs[8]</td></tr>";
}
echo "</table>";

$result = mysql_query("SELECT * FROM usuarios");
$totalRegistros = mysql_num_rows($result);
$totalPaginas = ceil($totalRegistros / $registrosPagina);

$paginaAnterior = $pag - 1;
$paginaSiguiente = $pag + 1;
if ($paginaSiguiente > $totalPaginas)
{
$paginaSiguiente -= 1;
}

if ($paginaAnterior < 1)
{
$paginaAnterior += 1;
}

echo "<br><center><a href='ranking.php?pag=$paginaAnterior'>Anterior</a> ";
for ($i = 1; $i <= $totalPaginas; $i++)
{
echo " <a href='ranking.php?pag=$i'>$i</a> ";
}
echo " <a href='ranking.php?pag=$paginaSiguiente'>Siguiente</a></center>";
echo "<center><a href='main.php'>Volver</a></center>";
?>
</body>
</html>
perfil_nuevo.php;

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin título</title>
<style type="text/css">
#apDiv1 {
position: absolute;
width: 626px;
height: 403px;
z-index: 1;
left: 393px;
top: 83px;
color: #000;
background-color: #999999;

border-radius:10px;
}
#apDiv2 {
position: absolute;
width: 200px;
height: 115px;
z-index: 2;
left: 409px;
top: 181px;
color: #F00;
background-color: #333333;
border-radius:10px;
}
#apDiv3 {
position: absolute;
width: 104px;
height: 35px;
z-index: 3;
left: 656px;
top: 115px;
color: #F00;
background-color: #333333;
border-radius:10px;
}
#apDiv4 {
position: absolute;
width: 105px;
height: 33px;
z-index: 4;
left: 777px;
top: 116px;
color: #F00;
background-color: #333333;
border-radius:10px;
}
#apDiv5 {
position: absolute;
width: 104px;
height: 31px;
z-index: 5;
left: 899px;
top: 117px;
background-color: #333333;
border-radius:10px;
}
#apDiv6 {
position: absolute;
width: 613px;
height: 163px;
z-index: 1;
left: -9px;
top: 134px;
background-color: #333333;
border-radius:10px;
}
#apDiv7 {
position: absolute;
width: 96px;
height: 42px;
border-style: solid;
z-index: 1;
left: 128px;
top: 38px;
font-size: 24px;
border: 4px;
border-color:#FFFFFF;
border-radius:10px;
background-color: #FFFFFF;
}
#apDiv8 {
position: absolute;
width: 67px;
height: 42px;
z-index: 1;
left: 134px;
top: 37px;
font-size: 24px;
border-radius:10px;
}
#apDiv9 {
position: absolute;
width: 67px;
height: 42px;
z-index: 1;
left: 134px;
top: 36px;
font-size: 24px;
border-radius:10px;
}
#apDiv10 {
position: absolute;
width: 116px;
height: 36px;
z-index: 2;
left: 417px;
top: 44px;
font-size: 24px;
border-radius:10px;
background-color: #FFFFFF;
}
#apDiv11 {
position: absolute;
width: 276px;
height: 63px;
z-index: 3;
left: 34px;
top: 82px;
border:3;
border-radius:10px;
}
#apDiv12 {
position: absolute;
width: 299px;
height: 63px;
z-index: 4;
left: 318px;
top: 82px;
border-radius:10px;
}
#apDiv5 div {
color: #F00;
border-radius:10px;
}
body {
background-color: #000;
border-radius:10px;
}
#apDiv13 {
position:absolute;
width:196px;
height:48px;
z-index:6;
left: 3px;
top: 31px;
border-radius:10px;
}
</style>
</head>

<body>
<div id="apDiv1"></div>
<div id="apDiv2">
<div id="apDiv6">
<div id="apDiv7">PUNTOS</div>
<div id="apDiv10">RANKING</div>
<div id="apDiv11"></div>
<div id="apDiv12"></div>
</div>
<div id="apDiv13">
USUARIO:

$rs[5];

</div>
</div>
<div id="apDiv3">
<div alin="center">ATACAR</div>
</div>
<div id="apDiv4">
<div align="center">ESPIAR</div>
</div>
<div id="apDiv5">
<div align="center">SMS</div>
</div>
</body>
</html>