NYCPHP Meetup

NYPHP.org

[nycphp-talk] Includes

Tom O'Neill tommyo at dolemite.org
Mon Sep 30 13:38:22 EDT 2002


If you do it like Dan said below make sure that you add the .inc to

AddType application/x-httpd-php  .inc .php

In the httpd.conf file or an htaccess file in the directory where you
header.inc file resides.  Or else it is possible to view the source code of
your *.inc files by accessing them directly.
http://www.yoursite.com/header.inc

Just my 2 cents....

TOM


----- Original Message -----
From: "Analysis & Solutions" <danielc at analysisandsolutions.com>
To: "NYPHP Talk" <talk at nyphp.org>
Sent: Monday, September 30, 2002 11:48 AM
Subject: Re: [nycphp-talk] Includes


> Hi Jessica:
>
> On Mon, Sep 30, 2002 at 11:49:23AM -0400, jessica kelly wrote:
> >
> > file called index.htm
> > <body>
> > <!-- #include virtual="header.htm" ¯>
> > <!-- #include virtual="menu.htm" ¯>
> > Wonderful and Exciting Contents go here...
> > <!-- #include virtual="footer.htm" ¯>
> > </body>
> >
> > And it will be parsed by PHP....Right?
>
> Not exactly.  Do this:
>
>   <body>
>   <?php
>   include('./header.inc');
>   include('./menu.inc');
>   ?>
>   Wonderful and Exciting Contents go here...
>   <?php
>   include('./footer.inc');
>   ?>
>   </body>
>
> I strongly suggest renaming include files to use the .inc extension.  This
> will make it clear which files are for public viewing and which files are
> just internal components.
>
>
> > Will this work with the regular PHP installed or do I need mod_php??
>
> This will work either way.
>
>
> > Which would be better to use as to be less of a drain on server
> > resources -  regular PHP or mod_php?
>
> In general module is better on speed, and I suspect, resources.  But, on
> the windows platforms, it's said that the module version isn't up to
> production quality/stability.
>
> --Dan
>
> --
>                PHP classes that make web design easier
>         SQL Solution  |   Layout Solution   |  Form Solution
>     sqlsolution.info  | layoutsolution.info |  formsolution.info
>  T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
>  4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409
>
>
> --- Unsubscribe at http://nyphp.org/list ---
>
>




More information about the talk mailing list