Formulario+Form+Menu+Smarty
| From: | "Victor Saldaña D." | Date: | Tue, 22 Jun 2004 23:05:01 +0000 |
| Subject: | Formulario+Form+Menu+Smarty | ||
| Groups: | php.general.es | ||
| Request: | Send a blank email to general-es+get-49543@lists.php.net to get a copy of this message | ||
Hola:
Necesito hacer q un formulario de ingreso cambie a un menu para el usuario si el
login es correcto. Para esto estoy usando smarty 2.6.3 y pensaba utilizar el if
q smarty me ofrece en los templates.
Cree la variable $_SESSION['loginok] para guardar si el usuario esta autorizado
o no y se la pase al template con:
$smarty->assign("LOGINOK", $_SESSION['loginok']);
en la planilla puse el siguiente codigo:
{if $LOGINOK == "yes"}
<b>:.:MENU :.:</b><br />
<a href='./kko_main/kko_newpost.php'>Nuevo
Post</a><br />
<a href='./kko_main/kko_editpost.php'>Editar
Post</a><br />
<a href='./kko_main/kko_erasepost.php'>Borrar
Post</a><br />
{else}
<b>:.: LOGIN :.:</b><br />
<form method="post"
action="./kko_main/kko_process.php">
<input type="hidden" name="proceso"
value="2">
<input type="text" name="userid"
size="15">Username<br><br>
<input type="password" name="pass"
size="15">Password<br><br>
<input type="submit" value="Log
in">
</form>
{/if}
En definitiva no funciona, luego de la pantalla q muestra un acceso exitoso
vuelve al form cuando deberia hacerlo al menu.
La verdad ya estoy un poco mareado buscandole solucion, si alguno de ustemes me
puede orientar se lo agradesco desde ya.
salu2!