Page 1 of 1

php class file extensions

Posted: Mon Aug 07, 2006 9:04 am
by Obadiah
k...im trying to create a class file in php or a authentification script. what extension do i use? do i save it as a .inc or a .php

Re: php class file extensions

Posted: Mon Aug 07, 2006 9:10 am
by Chris Corbyn
Obadiah wrote:k...im trying to create a class file in php or a authentification script. what extension do i use? do i save it as a .inc or a .php
Doesn't really make any difference but I'd suggest using .php since if the host is not set to parse .inc as PHP files the code will be displayed in a web browser for all to see.

Posted: Mon Aug 07, 2006 9:14 am
by Obadiah
so whats the difference in .inc and .php files.....do i even have to use .inc, can i replace all such files with a .php extension?

Posted: Mon Aug 07, 2006 9:30 am
by feyd
As d said, so long as the server parses the file as php it could be anything as far as extensions go. Yes, you can rename them to .php just fine. You just have to make sure all your code reflects such a change.

Re: php class file extensions

Posted: Tue Aug 08, 2006 1:56 pm
by Obadiah
d11wtq wrote:Doesn't really make any difference but I'd suggest using .php since if the host is not set to parse .inc as PHP files the code will be displayed in a web browser for all to see.
ok....how does the file know to look at that file bc the file that im creating uses globals and arrays from another file....the book that i have says name them .inc my guess is because .inc stands for includes(the file is used as a resource or back up) so how would u tell the program your creating like a web form to parse a .php....ive been wondering that ever since i started even with the .inc bc the one that its asking to reference is a totally different file then its using for the rest of the information