471,337 Members | 918 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 software developers and data experts.

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-)
Jul 15 '06 #1
4 2289

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.

Jul 15 '06 #2
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>
Jul 16 '06 #3
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" <we******@ptd.netwrote in message
news:Gw********************@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-)

Jul 16 '06 #4

"Juliette" <jr*********@jokeaday.netwrote in message
news:44***********************@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

Jul 16 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Husam | last post: by
3 posts views Thread by Damodhar | last post: by
21 posts views Thread by Jonathan Sachs | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.