If a file has a .inc extension, or if it has a .inc.php extension, is it
treated differently by the php interpreter? Or is it just a convention?
I've been calling my included files filename.php and it doesn't seem to
hurt anything. Is it wrong to do that?
E 4 42750
In article <eK************ ********@typhoo n.sonic.net>,
Phester <el**********@t hesearentthedro idsyourelooking for.yahoo.com>
wrote: If a file has a .inc extension, or if it has a .inc.php extension, is it treated differently by the php interpreter? Or is it just a convention?
I've been calling my included files filename.php and it doesn't seem to hurt anything. Is it wrong to do that?
E
The .php extension is for the webserver. It doesn't matter to PHP (or
the webserver) what the extension of an include file is, but the
extension of the main file must be recognizable as PHP to the webserver.
It's a good idea to give include files also .php as the final extension
for security reasons: if the include file is called directly in a web
browser, the webserver might show the contents of the file as text if it
doesn't recognize its extension. If it has a .php extension the source
code will not be visible.
..inc.php is just a convention.
JP
--
Sorry, <de*****@cauce. org> is een "spam trap".
E-mail adres is <jpk"at"akamail .com>, waarbij "at" = @.
On Sat, 20 Sep 2003 06:39:22 +0000, Phester wrote: If a file has a .inc extension, or if it has a .inc.php extension, is it treated differently by the php interpreter? Or is it just a convention?
I've been calling my included files filename.php and it doesn't seem to hurt anything. Is it wrong to do that?
E
..php (by default) is the normal extension for files.
..inc was (/ still is?) used normally for files being used in include() or
require() calls that reside on a remote server. Including a .php file from
a remote server causes problems as it's retrieved as a parsed file, so you
only retrieve the HTML output, rather than the PHP code you really want.
As .inc isn't normally assigned in the server configuration, this will
normally return as a text/plain file, meaning that all the PHP code is
available when included.
I've never needed to use .inc files personally for remote retrieval, some
seemed to use it in the earlier days for files include()d regardles of
them being local or remote.. personally I prefer .php wherever I can to
prevent accidental viewing of code.
Regards,
Ian
--
Ian.H [Design & Development]
digiServ Network - Web solutions www.digiserv.net | irc.digiserv.ne t | forum.digiserv. net
Programming, Web design, development & hosting.
> On Sat, 20 Sep 2003 06:39:22 +0000, Phester wrote:
If a file has a .inc extension, or if it has a .inc.php extension, is it treated differently by the php interpreter? Or is it just a convention?
....
Jan Pieter Kunst wrote: The .php extension is for the webserver. It doesn't matter to PHP (or the webserver) what the extension of an include file is, but the extension of the main file must be recognizable as PHP to the webserver.
It's a good idea to give include files also .php as the final extension for security reasons: if the include file is called directly in a web browser, the webserver might show the contents of the file as text if it doesn't recognize its extension. If it has a .php extension the source code will not be visible.
.inc.php is just a convention.
JP
....
Ian.H [dS] wrote:
.php (by default) is the normal extension for files.
.inc was (/ still is?) used normally for files being used in include() or require() calls that reside on a remote server. Including a .php file from a remote server causes problems as it's retrieved as a parsed file, so you only retrieve the HTML output, rather than the PHP code you really want.
Thanks for the replies. Now it makes sense.
Phester
"Phester" <el**********@t hesearentthedro idsyourelooking for.yahoo.com> wrote: On Sat, 20 Sep 2003 06:39:22 +0000, Phester wrote: Jan Pieter Kunst wrote: > The .php extension is for the webserver. It doesn't matter to PHP (or > the webserver) what the extension of an include file is, but the > extension of the main file must be recognizable as PHP to the
webserver. > > It's a good idea to give include files also .php as the final extension > for security reasons: if the include file is called directly in a web > browser, the webserver might show the contents of the file as text if
it > doesn't recognize its extension. If it has a .php extension the source > code will not be visible. > > .inc.php is just a convention. > > JP Ian.H [dS] wrote: .php (by default) is the normal extension for files. .inc was (/ still is?) used normally for files being used in include()
or require() calls that reside on a remote server. Including a .php file
from a remote server causes problems as it's retrieved as a parsed file, so
you only retrieve the HTML output, rather than the PHP code you really want.
Thanks for the replies. Now it makes sense. Phester
To prevent viewing of inc files, put this in an .htaccess file:
<Files ~ "\.inc$">
Order allow,deny
Deny from all
</Files>
To prevent viewing of the .htaccess file:
<Files ~ "^\.htacces s$">
Order allow,deny
Deny from all
</Files>
Will result in File not Found errors when such file is requested directly,
even though it may well be there!
In Apache 1.3 (I think) FilesMatch is preferred instead of Files.
Ivo This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: yet another michael |
last post by:
hello, bit of a problem which ive played around with for a bit but
dont seem to be getting going with:-<
Main page
is a wrapper to split code and design.
It loads a functional page
through ob_start to let me use the headers
The class definition
|
by: vishal |
last post by:
hello
vishal here.
i have seen some scripts which includes file like
include('time.inc')
so can anyone tell me what this file contain. and what is extension
|
by: Steven Burn |
last post by:
Just wondering if anyone knows of a way to block the HEAD method from being
used outside of the server? (i.e. by a program, or external website).
--
Regards
Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk
|
by: rick |
last post by:
Hello everyone
I am trying to locate the sample files used in "A tour of the code - NavBar" for the redesign of the msdn online website in 1998. They were written and developed by Robert Carter and George Young and consist of several include files and css files, prepared for ASP. I located the documents in the MSDN Library Archive and this is very, very close to what I would like to do for our own website. The link for the sample downloads...
|
by: michaaal |
last post by:
I have two folders in my website...
Folder1 (this is where my #include file is, this is where the style.css is)
--Folder2
(Folder2 is inside of Folder1)
Folder2 contains a file that has this #include statement...
<!--#include file="../include.inc"-->
| |
by: hntgzr |
last post by:
I am trying to include a function in a .php file on a different server from
the main .php files.
I am using:
include_path=http://www.anotherserver.com/foldername;
include(http://www.anotherserver.com/foldername/phpfiletocall.inc);
The .inc file is php formatted. Variables are passed to it (not via GET or
POST though) and returned using return(variablenames, etc);
|
by: summer |
last post by:
Hello,
I'm not receiving my email, I believe I'm almost there, but can't
figure out what I'm missing. Any Clue would be appreciated.
Here's my html and asp code. I've included the cdovbs.inc file in the
root of my website, I thought that maybe my error.
Thank you,
Summer
|
by: Steven Borrelli |
last post by:
Hello,
I am using the <?php include() ?statement on my website for
organizational purposes. However, one of my includes contains some
PHP code. Is there any way for the server to actually parse the
include? I've tried this before, and it did not parse the include.
Rather, it included the file as just plain ASCII.
=======================
/*EXAMPLE 1*/
/*index.php*/
|
by: CES |
last post by:
All,
How do you write out a variable in a ASPX .inc?? I've used the following in
my code and it worked until I changed the date & MyWebSite, to a server side
write... is there any way of getting this to work within an inc file
structure? Thanks in advance. - CES
<%
Response.WriteFile("Yourfile.FileExtension");
%>
----- Yourfile.FileExtension ------
<div id="copyright">
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |