Advantages or disadvantages of .inc files

This is a discussion on Advantages or disadvantages of .inc files within the alt.comp.lang.php forums, part of the PHP Programming Forums category; What are the advantages or disadvantages of .inc files over the 'include' statement. I can't seem to find that ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-15-2006
IchBin
 
Posts: n/a
Default Advantages or disadvantages of .inc files


What are the advantages or disadvantages of .inc files over the
'include' statement. I can't seem to find that information at the PHP
website.

Also the same for form building inline, I guess you would call it, and
HTML template objects. File types of .tpl and .ihtml?

Thanks in Advance...
IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
__________________________________________________ ________________________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
Reply With Quote
  #2 (permalink)  
Old 07-15-2006
frizzle
 
Posts: n/a
Default Re: Advantages or disadvantages of .inc files


IchBin wrote:
> What are the advantages or disadvantages of .inc files over the
> 'include' statement. I can't seem to find that information at the PHP
> website.
>
> Also the same for form building inline, I guess you would call it, and
> HTML template objects. File types of .tpl and .ihtml?
>
> Thanks in Advance...
> IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
> __________________________________________________ ________________________
>
> 'If there is one, Knowledge is the "Fountain of Youth"'
> -William E. Taylor, Regular Guy (1952-)


To answer your first question:
if *.inc files were called directly via the browser's url, most likely
it's content would be displayed unparsed. So your entire code would be
naked on the internet, including possible passwords etc.)

Instead if you want to use '.inc', you could use file.inc.php, which
would be parsed before outputted to the browser.

Frizzle.

Reply With Quote
  #3 (permalink)  
Old 07-16-2006
Juliette
 
Posts: n/a
Default Re: Advantages or disadvantages of .inc files

frizzle wrote:
> IchBin wrote:
>> What are the advantages or disadvantages of .inc files over the
>> 'include' statement. I can't seem to find that information at the PHP
>> website.
>>
>> Also the same for form building inline, I guess you would call it, and
>> HTML template objects. File types of .tpl and .ihtml?
>>
>> Thanks in Advance...
>> IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
>> __________________________________________________ ________________________
>>
>> 'If there is one, Knowledge is the "Fountain of Youth"'
>> -William E. Taylor, Regular Guy (1952-)

>
> To answer your first question:
> if *.inc files were called directly via the browser's url, most likely
> it's content would be displayed unparsed. So your entire code would be
> naked on the internet, including possible passwords etc.)
>
> Instead if you want to use '.inc', you could use file.inc.php, which
> would be parsed before outputted to the browser.
>
> Frizzle.
>



Or include the following in your .htaccess file:

<Files ~ "\.inc$">
Order allow,deny
Deny from all
</Files>
Reply With Quote
  #4 (permalink)  
Old 07-16-2006
Tony Marston
 
Posts: n/a
Default Re: Advantages or disadvantages of .inc files

The only "advantage" for using different extensions is that each extension
helps identify the contents of each file. I use .php for scripts which can
be executed, and .inc for scripts which must be included instead of
executed. I presume Smarty use .tpl to identify its template files. It is
just a matter of convention.

--
Tony Marston

http://www.tonymarston.net
http://www.radicore.org



"IchBin" <weconsul@ptd.net> wrote in message
news:GwmdnfJ6qrXPliTZUSdV9g@ptd.net...
>
> What are the advantages or disadvantages of .inc files over the 'include'
> statement. I can't seem to find that information at the PHP website.
>
> Also the same for form building inline, I guess you would call it, and
> HTML template objects. File types of .tpl and .ihtml?
>
> Thanks in Advance...
> IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
> __________________________________________________ ________________________
>
> 'If there is one, Knowledge is the "Fountain of Youth"'
> -William E. Taylor, Regular Guy (1952-)



Reply With Quote
  #5 (permalink)  
Old 07-16-2006
Tony Marston
 
Posts: n/a
Default Re: Advantages or disadvantages of .inc files


"Juliette" <jrf_no_spam@jokeaday.net> wrote in message
news:44b9b6da$0$73418$dbd4f001@news.wanadoo.nl...
> frizzle wrote:
>> IchBin wrote:
>>> What are the advantages or disadvantages of .inc files over the
>>> 'include' statement. I can't seem to find that information at the PHP
>>> website.
>>>
>>> Also the same for form building inline, I guess you would call it, and
>>> HTML template objects. File types of .tpl and .ihtml?
>>>
>>> Thanks in Advance...
>>> IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
>>> __________________________________________________ ________________________
>>>
>>> 'If there is one, Knowledge is the "Fountain of Youth"'
>>> -William E. Taylor, Regular Guy (1952-)

>>
>> To answer your first question:
>> if *.inc files were called directly via the browser's url, most likely
>> it's content would be displayed unparsed. So your entire code would be
>> naked on the internet, including possible passwords etc.)
>>
>> Instead if you want to use '.inc', you could use file.inc.php, which
>> would be parsed before outputted to the browser.
>>
>> Frizzle.
>>

>
>
> Or include the following in your .htaccess file:
>
> <Files ~ "\.inc$">
> Order allow,deny
> Deny from all
> </Files>


You can also put .inc files in a directory which is outside the web root, or
in a password-protected directory so that its contents cannot be accessed
through the web server.

--
Tony Marston

http://www.tonymarston.net
http://www.radicore.org



Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 01:53 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0