Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/11/2010, 08:29
darion
 
Fecha de Ingreso: octubre-2010
Mensajes: 233
Antigüedad: 13 años, 7 meses
Puntos: 3
variable de url en javscript

Hola que tal necesito que al apretar una tecla me pase a la siguiente pagina pero no puedo lograr pasar la url de la pagina a javascript les paso el codigo para que me entiendan mejor

Muchas gracias de antemano


<?php

require_once("class/class.php");
$sql=mysql_query("select * from usuarios ORDER BY usuario_id ",Conectar::con());
$res=mysql_num_rows($sql);
$registros=1;
$pagina=$_GET["num"];
if (is_numeric($pagina))
{
$inicio=(($pagina -1)*$registros);
}
else
{
$inicio=0;
}
$sql=mysql_query("select * from usuarios ORDER BY usuario_id LIMIT $inicio,$registros ",Conectar::con());
$paginas=ceil ($res/$registros);
?>


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="js/funciones.js" type="text/javascript"></script>
<title></title>
<link href="css/ingreform.css" rel="stylesheet" type="text/css">



<script language="javascript" type="text/javascript">

ACA TENGO EL PROBLEMA >>>> shortcut.add('right',function (){window.location.href='listar_usuarios.php?num= ACA NO SE QUE VA';});


shortcut.add("numpad 1",function(){window.location.href='ingr_usuario.p hp';});
shortcut.add("1",function(){window.location.href=' ingr_usuario.php';});
</script>





<h2 align="center">Usuarios del Sistema</h2>
</head>
<body onLoad="document.a.b.focus()">
<?php

while($row = mysql_fetch_array($sql))
{
?>
<form name="a">
<table width="100%" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td>Código:</td>
<td><input name="b" type="text" readonly="true" value="<?php echo $row ["0"];?>"></td>
<td>Apellido:</td>
<td><input name="" type="text" readonly="true" value="<?php echo $row ["1"];?>"></td>
</tr>
<tr>
<td>Nombre:</td>
<td><input name="" type="text" readonly="true" value="<?php echo $row ["2"];?>"></td>
<td>Fecha de Nacimiento:</td>
<td><input name="" type="text" readonly="true" value="<?php echo $row ["3"];?>"></td>
</tr>
<tr>
<td>Teléfono:</td>
<td><input name="" type="text" readonly="true" value="<?php echo $row ["4"];?>"></td>
<td>Celular:</td>
<td><input name="" type="text" readonly="true" value="<?php echo $row ["5"];?>"></td>
</tr>
<tr>
<td>Dirección:</td>
<td><input name="" type="text" readonly="true" value="<?php echo $row ["6"];?>"></td>
<td>Localidad:</td>
<td><input name="" type="text" readonly="true" value="<?php echo $row ["7"];?>"></td>
</tr>
<tr>
<td>Provincia:</td>
<td><input name="" type="text" readonly="true" value="<?php echo $row ["8"];?>"></td>
<td>Nombre de Usuario:</td>
<td><input name="" type="text" readonly="true" value="<?php echo $row ["9"];?>"></td>
</tr>
<tr>
<td>Perfil:</td>
<td><input name="" type="text" readonly="true" value="<?php echo $row ["11"];?>"></td>
<td>Fecha de Creación:</td>
<td><input name="" type="text" readonly="true" value="<?php echo $row ["12"];?>"></td>
</tr>
<tr>
<td>Hora de Creación:</td>
<td><input name="" type="text" readonly="true" value="<?php echo $row ["13"];?>"></td>
</tr>
</table>
</form>

<?php
}
?>
<table width="100%" cellpadding="0" cellspacing="0" id="abajo" >
<tr>
<td id="lis_edit_elim">
<?php
if ($pagina>1)
echo "<a href='listar_usuarios.php?num=". ($pagina-1) . "'><-- Anterior</a> ";

?>
</td>
<td id="lis_edit_elim">
<?php

if ($pagina<$paginas)

echo "<a href='listar_usuarios.php?num=". ($pagina+1) . "'>Siguiente --></a>";



?>

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




</body>
</html>