SunQuest
 
           PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old December 27th, 2002, 09:38 PM
Volitics Volitics is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Location: Knoxville, Tennessee (U.S.A.)
Posts: 58 Volitics User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 15 sec
Reputation Power: 6
When Must I Use ".inc" Suffix Instead Of ".php" Suffix?

::Question::

I have been using an "includes" file to include a table into a page. In order to get the "includes" file to work the way I want it to work on my server I must treat the file as if it were a PHP file and use a ".php" suffix instead of an ".inc" suffix. The ".php " suffix seems to work fine.

My question is this: Is there a specific reason why or instance where I must use the ".inc" suffix instead of the ".php" suffix for "includes" files?

Thank you in advance.

Volitics

Reply With Quote
  #2  
Old December 27th, 2002, 10:36 PM
Lindset Lindset is offline
weirdomoderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: Alta, Norway
Posts: 370 Lindset User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to Lindset Send a message via AIM to Lindset
Hi,

The .inc extension is often used to point out that the file should be included, and not loaded directly.

There's really no good reason to use .inc. You should always end your file names with .php. If you don't use the .php extension, for example apache won't send the file to the php parser, which in return makes it print out the content of the file as clear text (displaying all your source code).

Although it IS possible to make apache treat the .inc files as .php files, it's not standard, and is therefore discouraged.

If you really really really want to use .inc, you could use .inc.php instead..

Hope that answers your question
__________________
Best Regards,
Håvard Lindset

Reply With Quote
  #3  
Old December 29th, 2002, 08:59 AM
Volitics Volitics is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Location: Knoxville, Tennessee (U.S.A.)
Posts: 58 Volitics User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 15 sec
Reputation Power: 6
Thank you for the help.

Mr. Lindset;

Thank you for your kind response.

Regards;

Volitics

Reply With Quote
  #4  
Old December 30th, 2002, 07:33 AM
wAr-AnGeL wAr-AnGeL is offline
Forum Security
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Behind You
Posts: 479 wAr-AnGeL User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m
Reputation Power: 7
Send a message via ICQ to wAr-AnGeL Send a message via AIM to wAr-AnGeL
i usually make all my files i need included inside an 'include' directory with a .inc.php extension, my server has no problems interpereting it.

so...

somefile.inc.php works fine
__________________




"Only Linux users see the end of crashes."
- Pl4t0

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > When Must I Use ".inc" Suffix Instead Of ".php" Suffix?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway