You are here: Brackets across includes « PHP Programming Language « IT news, forums, messages
Brackets across includes

Posted by pengypenguin on 11/24/97 11:56

Hello all,

I am trying to create a user authentication system, and I would like to
separate the authentication code into include files. As I see it, the
basic flow would go something like this:

if (not authentic) {
display login
} else {
display content
}

I would like to separate this code so that the login bit is in an
included file. I imagined the breakup like this:

file: [auth_head.php]
-----------------------
if (not authentic) {
display login
} else {
-----------------------

file: [auth_foot.php]
-----------------------
}
-----------------------

So in each file which requires authentication, I can simply include the
first bit in the head, the second bit at the bottom, and put the
content in the middle. Makes sense, right?

Unfortunately, it seems that you cannot continue a { bracket }
statement across includes in this manner, as php errors. (It wants you
to wrap up your brackets before the end of the file.)

Does anyone know of a solution to this problem, or perhaps a
work-around?

Thanks very much, in advance.

-- Whit Nelson

 

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

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