[thelist] What is SOP on Include files in PHP?

Robin Hastings robin at rhastings.net
Tue May 29 14:19:28 CDT 2001


> Hey Gang!
>
> I'm reading that it's good practice to set up include files with
> an .inc file source to separate
> them from normal PHP script?  What are your thoughts on this?
>
> And if I should do this, in lieu of other extensions, how do I
> set up my Web server configuration
> to parse .inc files as PHP files?
>
> Many thanks,
>
> Sean
You don't have to set up those include files to be parsed - they will parse
as part of the .php file you're including them in, but see below as to why
you might not want to do that!

You can certainly call your included files anything you want - .inc, .sean,
.whatever - but if you don't configure your server to parse that extension,
it will be output to the browser in plain text - file path to database,
plain text passwords and all. How you configure your server depends on what
you use, I'm an IIS girl myself, though I'm trying to learn Apache on my
home machine!

Robin Hastings
Webmistress - InterTec Designs
robin at intertecdesigns.com
http://www.intertecdesigns.com





More information about the thelist mailing list