hi all,

plz explain diffrence between inc and php

like include("menu.inc"); include("menu.php");


every body is invited

Recommended Answers

All 4 Replies

Hi..

Not much difference... The code behind both can remain same...
Just the extension is different...

What initially it started was that inc was used to include the files in plain html.. Html also has a command to include the files...
So people used to name that file filename.inc
But with php becoming popular, people started using the php based functions to include the files and the file extension changed to php because it contained mostly the php functions and classes.

But on a bigger note, not much difference between two...

Apache is normally not configured to parse a .inc file so, if a user views the file, the source code will be revealed as plain text. However, if the users views the php file, the server will parse everything and the user will only see html.

Best not to use .inc files if you have secure information on them, as mentioned above, they can be read as a text file.

Their is not much difference but some servers provide ".inc" extension as standard for includes files, ".inc" files are parsed on server side on those server. Not every server software follows or requires special configuration.

Hi..

What initially it started was that inc was used to include the files in plain html.. Html also has a command to include the files...
So people used to name that file filename.inc
..

:ooh: Which command are you talking about to include files in HTML.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.