php src
Moderator: General Moderators
No, code cannot be viewed in a regular php page just by right clicking and then View Source.
Yes, it is possible to include a php file without the php extension.
Check this pageout for more info.
On my server i include .oro, .sam, and even .asp php pages in some scripts. It's just for fun though.
Yes, it is possible to include a php file without the php extension.
Check this pageout for more info.
On my server i include .oro, .sam, and even .asp php pages in some scripts. It's just for fun though.
No - if you have MS Word installed, the browser would launch it and display that file.when u include that php file into a html doc. , will the html doc show "hello world"?
However, as McGruff said - e.g. if you have a file "db_connect.inc" which is say the php-file to establish the MySQL-connection AND your haven't set your server to parse files with the extension ".inc" it will be displayed just a normal ".txt"-file, everyone could see the source.
I don't understead that answer, he used a php file in a html file.patrikG wrote:No - if you have MS Word installed, the browser would launch it and display that file.when u include that php file into a html doc. , will the html doc show "hello world"?
The php file is genarating "hello world", and it's opening MS Word for that?
I think the correct answer is Yes.
There are 2 way's to do it right.patrikG wrote:However, as McGruff said - e.g. if you have a file "db_connect.inc" which is say the php-file to establish the MySQL-connection AND your haven't set your server to parse files with the extension ".inc" it will be displayed just a normal ".txt"-file, everyone could see the source.
1. Yust call your include files '.inc.php' instead of '.inc'
2. Put them in a .htaccess forbidden directory. This wil not allow web browser to show your .inc but php stil can access them.