For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > January 2005 > Re: [SMARTY] Authentication with Smarty









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [SMARTY] Authentication with Smarty
HarryG

2005-01-03, 3:59 pm

> index.tpl
> <DOCTYPE >
> <html>
> <head>
> <body>
> {if $loginflag}{inslude file='mambers.tpl' assign list of
> variables to template}{else}}{inslude file='loginform.tpl'}
> {/if}



Can you please elaborate on the above template file. I don't quite follow.

Thanks
HarryG

"Zoran Knezevic" <zoka@hotbox.ru> wrote in message
news:200311051130.hA5BUP90026409@www3.hotbox.ru...
> Vonleigh Simmons <nospam@illusionart.com>:
>
> recently discovered
> some of the
> me if this
> available to
> security.php page
> a
> exactly would I go
> security.php page
> would display
> security.tpl).
>
> this is pseudo-code how I would do it:
>
> index.php
> <?
> require (all files that are necessery);
>
> $loginflag= false;
>
> if (function_that_checks_is_user_logged
> ($list_of_parameters)) $loginflag= true;
>
> $smarty->assign('loginflag',$loginflag)
>
> //other code and assignmants here
> $smarty->dislplay('index.tpl');
>
> //disconect database and other stuff
> ?>
>
> index.tpl
> <DOCTYPE >
> <html>
> <head>
> <body>
> {if $loginflag}{inslude file='mambers.tpl' assign list of
> variables to template}{else}}{inslude file='loginform.tpl'}
> {/if}

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com