Ver Mensaje Individual
  #1 (permalink)  
Antiguo 19/08/2005, 23:33
Avatar de hendrix
hendrix
 
Fecha de Ingreso: agosto-2003
Ubicación: chile lindo
Mensajes: 1.109
Antigüedad: 20 años, 7 meses
Puntos: 7
autenticacion en PAGINATOR,.ayudenme con codigo

hola amigos
ahora me surgio la inquietud de como hacer que pida contraseña y usuario al entrar a la paginacion.

construi un formulario (user y pass) y el codigo de paginator lo deje asi para que comprobara si la pass era correcta: (solo quiero un usuario y un pass y no mas),......ME FUNCIONO PERO AL NAVEGAR POR LAS OTRAS PAGINAS QUE ME DA EL PAGINADOR ME SALE (USUARIO O PASS INCORRECTA),...SOLO ME DEJA ENTRAR A LA PRIMERA PAGINA. HAY QUE HACER ALGO EN EL CODIGO PAGINATOR.INC.PHP???

por ejemplo me deja entrar a http://www.xxxxxx.com/paginar.php pero al navegar por los resultdos, es decir a http://www.xxx.pagiinar.php?_pagi_pg=2
me dice contraseña o user incorrectos,.....como lo hago,.....espero que me entiendan,...ahi va el codigo.



<?
// Comparamos a ver si son correctos
if ($usuario=="user" && $password=="mi_pass")
{
$valido="si";
}
else
{
$valido="no";
}
?>
<html>
<head>
<? if ($valido=="si")
{
?>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<table width="447" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>
<div align="center"><font color="#006600" size="3" face="Verdana, Arial, Helvetica, sans-serif"><font size="4"><b><font size="3">TITULO</font></b></font></font></div>
</td>
</tr>
</table>
<table width="600" border="0" cellspacing="0" cellpadding="0" align="center" height="65">
<tr>
<td>
<div align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif" color="#006600">Aqu&iacute;
TITULO1</font></div>
</td>
</tr>
</table>
<p align="center"><font color="#006600">OTRO TITULO
R.M.S</b></font></p>
<table width="699" border="1" align="center" bgcolor="#CCCCCC">
<tr>
<td colspan="3" height="34">
<div align="left"><font face="Verdana, Arial, Helvetica, sans-serif"><b><font color="#006600" size="2">ANTECEDENTES
</font></b></font></div>
</td>
</tr>
<?
//Conexión a la base de datos
$con = mysql_connect("localhost","USER","PASS_BD") or die (mysql_error());
mysql_select_db("BD",$con) or die (mysql_error());

//Sentencia sql (sin limit)
$_pagi_sql = "SELECT * FROM form";

//cantidad de resultados por página (opcional, por defecto 20)
$_pagi_cuantos = 1;

//Incluimos el script de paginación. Éste ya ejecuta la consulta automáticamente
include("paginator.inc.php");
while($row = mysql_fetch_array($_pagi_result)){
?>

<?echo$row['I3']?>
</td>
<td width="169">
<?echo$row['J3']?>
</td>
</tr>
<?
}//fin del while
?>
</table>
<?
echo"<p>".$_pagi_navegacion."</p>";
?>
<? }
else
{
?>
<p>USUARIO O CONTRASEÑA INCORRECTA</p>
<? } ?>
</body>
</html>