NYCPHP Meetup

NYPHP.org

[nycphp-talk] Includes

Daniel Kushner nyphp at websapp.com
Mon Sep 30 13:59:03 EDT 2002


We discussed the .inc issue in the last PHP meeting. To two safest solutions
are:
1. Have the .inc files outside of the web directory root.
2. Configure Apache (or .htaccess) not to display .inc files.

Doing: AddType application/x-httpd-php  .inc .php
will still enable the execution of the PHP code although the code will not
be displayed. It is not wise to allow code to be executed from remote and by
anyone.

Regards,
Daniel Kushner
_________________________________________
Need hosting? http://thehostingcompany.us




> -----Original Message-----
> From: Tom O'Neill [mailto:tommyo at dolemite.org]
> Sent: Monday, September 30, 2002 1:32 PM
> To: NYPHP Talk
> Subject: Re: [nycphp-talk] Includes
>
>
> 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