PHP Includes failing to include file from subdirectory?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Where's that "foot-in-mouth" smiley? :-p
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

FYI, Macs are UNIX systems. They use "/" natively. It's only microsoft who decided to be different.
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

It's only microsoft who decided to be different.
Grumble time! Microsoft also succeeded in standardizing the errors in JavaScript as opposed to standardizing the correct behaviour because they didn't want to break stuff and now we are forever stuck with such wonders as:

Code: Select all

alert(typeof null) // "object"
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

ole wrote:
It's only microsoft who decided to be different.
Grumble time! Microsoft also succeeded in standardizing the errors in JavaScript as opposed to standardizing the correct behaviour because they didn't want to break stuff and now we are forever stuck with such wonders as:

Code: Select all

alert(typeof null) // "object"
Difting off topic, but I love this error:

"Error: Object expected. Code: 0".
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

PATH_SEPARATOR - Typically ';' or ':' (though I can't really think of anything else it would be).

DIRECTORY_SEPARATOR - Typically either '\' or '/' (and again, not sure if there are others).

I think there is another one (PHP_EOL) that puts out the '\n' or '\r' or '\r\n' depending the system. Doesn't it make sense to use them when developing apps for unknown systems? Maybe I am just weird?
User avatar
maliskoleather
Forum Contributor
Posts: 155
Joined: Tue May 15, 2007 2:19 am
Contact:

Post by maliskoleather »

Everah wrote:Doesn't it make sense to use them when developing apps for unknown systems? Maybe I am just weird?
yes, but, honestly, it isnt a major nessicity to use them, with a few exceptions.

I mean, PHP natively uses the '/' as a directory separator, so its not really nessicary to use it in include paths, only when passing paths to an external program.

and really, how often does anyone use the path separator? Its not that hard to use that constant.

really, the true advantages of DIRECTORY_SEPARATOR and PHP_EOL are for saving files and passing information to other on-server programs( ie system(); ) .PATH_SEPARATOR should always be used, just for consistancy and usability among other systems
Post Reply