Hice un menu dinamico en php el cual genera un select de una bd y luego lo imprime como link's pero tengo un inconveniente y es que cuando inicio sesion la primera vez no me muestra las opciones y luego a la segunda si siempre la primera vez falla que podria estar pasando ?
Código PHP:
<?session_start();
include("carpeta\libreria1.php");
$usuario=strtoupper($_SESSION['s_username']);
$clave=$_SESSION['s_userpwd'];
$idAp='a';
$lnk=ConMySql('bd','localhost');
$consulta="select nmbre, url
from bdpermisosusr p, bdopciones o
where usr='$usuario'
and idaplccion=idaplccion
and actvo='S'
and idopcion=idopcion
and idaplccion='$idAp'";
$resultado=mysql_query($consulta,$lnk);
$numregistros=mysql_numrows($resultado);
?>
<HTML>
<HEAD>
<TITLE>Navegacion</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel='stylesheet' type='text/css' href='css\style.css' /></HEAD>
<BODY BGCOLOR="white" leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>
<TABLE>
<TR><TD>
<TR ALIGN=CENTER>
<TD>
<strong>Navegacion </strong> <p>
</TD>
</TR>
<TR><TD>
<strong>:-: Opciones para</strong> <?echo $usuario?><br>
</TD></TR>
<?
$i=0;
while ($i < $numregistros)
{
$Opcion=mysql_result($resultado,$i,nmbre);
$url=mysql_result($resultado,$i,url);
?>
<tr>
<td>¬ <a href="<?echo $url;?>" TARGET="Principal"><?echo $Opcion;?> </B></td>
</tr>
<?
$i++;
}
?>
<TR><TD>
<br> <P>
</TD></TR>
<TR><TD>
<strong>:-:</strong> <strong><a href="Salida.php" TARGET="_top">Salir</a></strong><br>
<P>
</TD></TR>
<TR><TD><hr>
</TD></TR>
si no he sido lo suficientemente clara por fa preguntenme para que me puedan colaborar , gracias...