You are here: Re: Authentication with $_SESSION « PHP Programming Language « IT news, forums, messages
Re: Authentication with $_SESSION

Posted by Nadine St-Amand on 10/02/11 11:19

TekWiz wrote:

> this is what i do, first thing:
> if (validate($_SESSION[var])) {
> [echo the complete page]
> } else die(header("Location: $login_page_url"));
>
> Make sure you read up on the header() function: http://www.php.net/header
>
> --TekWiz

If you write it like this, you keep the code cohesive
(i means, all auth code together, application code together):

if (!validate($_SESSION[var])) die(header("Location: $login_page_url"));

[echo the complete page]

--
Nadine St-Amand
Code generator sql2php : http://www.phpbackend.com/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация