Page 1 of 2
php src
Posted: Thu Apr 24, 2003 8:26 pm
by nincha
can any one see or read the php source or the php code? and is it possible to include a php file without having a php extension?
Posted: Thu Apr 24, 2003 8:31 pm
by m3mn0n
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.

Posted: Thu Apr 24, 2003 8:39 pm
by nincha
say u have a php code that echo "hello world"
when u include that php file into a html doc. , will the html doc show "hello world"?
Posted: Thu Apr 24, 2003 9:27 pm
by McGruff
Yes you can include a php file without the php extension but (I only half remember this) I think this is LESS secure.
The server will be set up to parse php files: I think other extensions might be viewable with a "view source" in the browser.
I should know that but it's late here

Posted: Thu Apr 24, 2003 9:39 pm
by patrikG
when u include that php file into a html doc. , will the html doc show "hello world"?
No - if you have MS Word installed, the browser would launch it and display that file.
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.
Posted: Fri Apr 25, 2003 1:57 am
by []InTeR[]
patrikG wrote:when u include that php file into a html doc. , will the html doc show "hello world"?
No - if you have MS Word installed, the browser would launch it and display that file.
I don't understead that answer, he used a php file in a html file.
The php file is genarating "hello world", and it's opening MS Word for that?
I think the correct answer is
Yes.
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.
There are 2 way's to do it right.
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.
Posted: Fri Apr 25, 2003 7:08 am
by patrikG
[]InTeR[], you're right. Too long in front of the computer and your brain fries. You end up seeing "doc" and "document" and the first thing you think of is a bloody MS Word file.

Posted: Fri Apr 25, 2003 7:11 am
by []InTeR[]
Posted: Fri Apr 25, 2003 7:25 am
by volka
resistance is futile

Posted: Fri Apr 25, 2003 8:30 am
by patrikG
...must resist...must...not...let...Billy...Boy...take...over...
must...not...
2 seconds later:
"Hello. And where do YOU want to go today?"

Posted: Fri Apr 25, 2003 12:47 pm
by m3mn0n
Welcome to the club, you are Microsoft driod number
93,394,595!
Posted: Fri Apr 25, 2003 8:43 pm
by McGruff
Just noticed your new pic Oromian.
This babe thing.. is that what happens when you become a "master"?
Posted: Fri Apr 25, 2003 8:44 pm
by m3mn0n
yup. It's a nessesary self transformation.
...hehe
Posted: Fri Apr 25, 2003 8:51 pm
by McGruff
Wot?! There really aren't any babes hanging out here?
And I was working so hard to impress all these gorgeous creatures with my coding skills..
Well that's it I'm quitting php right now.

Posted: Fri Apr 25, 2003 8:56 pm
by m3mn0n
lol
don't do that, you'll see the big secret when you get here.
