Skip to main content
October 6, 2006
Question

Is there a PHP Application...

  • October 6, 2006
  • 2 replies
  • 333 views
I have worked on some coldfusion and I know that coldfusion supports "application.cfm" where you can place codes or login security. Those of you's reading this will understand what I mean by the "application.cfm" in ColdFusion.

What I like to know is there a equivalent type of code for php? If so, can you please explain step by step. Thank you.


AdonaiEchad
This topic has been closed for replies.

2 replies

Inspiring
October 6, 2006
"AdonaiEchad" <webforumsuser@macromedia.com> wrote in message
news:eg5mhn$ng7$1@forums.macromedia.com...
>I have worked on some coldfusion and I know that coldfusion supports
> "application.cfm" where you can place codes or login security. Those of
> you's
> reading this will understand what I mean by the "application.cfm" in
> ColdFusion.
>
> What I like to know is there a equivalent type of code for php? If so,
> can
> you please explain step by step. Thank you.

David's answer is right on, but you might be interested in an article I
wrote for CMX (free for members) about using an application.php file to
handle site-wide things like logging in, $_GET/$_POST cleanup, validation,
session starting, etc:
http://www.communitymx.com/abstract.cfm?cid=54E52

I used the application.php file in Cartweaver and it simplified a lot of
things.

Tom Muck


Inspiring
October 6, 2006
AdonaiEchad wrote:
> I have worked on some coldfusion and I know that coldfusion supports
> "application.cfm" where you can place codes or login security.
>
> What I like to know is there a equivalent type of code for php?

There isn't an equivalent of application.cfm in PHP. The normal practice
is to include files explicitly using include().

If you control the server yourself, you could set auto_prepend_file in
php.ini, but that's not possible on a shared server. It's possible to
set auto_prepend_file on a per-directory basis, but it requires an
Apache server plus the permission to override Apache defaults.

Short answer: use include().

--
David Powers
Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
http://foundationphp.com/