template tutorial: _FILE_ error

Post here is you are having problems with any of the tutorials.
Post Reply
salrathor1
Posts: 26
Joined: Tue Jun 21, 2011 2:23 am

template tutorial: _FILE_ error

Post by salrathor1 »

Hey guys,

I'm quite new to PHP and I'm trying to work my way through some of the tutorials on here, but i'm having a little problem with the template tutorial.

Jacek talks about using $core_path = dirname(_FILE_); to locate the folder where the current script is stored but when I try to run the code it doesn't return anything. i.e. in the tutorial it says to run die(_FILE_).

I'm assuming there's an error somewhere in my PHP setup? I'm just wondering if someone can help me locate it.

I'm running xampp on MAC OSX if that helps.

Thanks in advance
Sal
JelvinJS7
Posts: 341
Joined: Thu May 12, 2011 8:40 pm

Re: template tutorial: _FILE_ error

Post by JelvinJS7 »

It's two __ underscores on each side.

$core_path = dirname(__FILE__);

//that is correct, the incorrect one is V this one

$core_path = dirname(_FILE_); //what you're doing 

salrathor1
Posts: 26
Joined: Tue Jun 21, 2011 2:23 am

Re: template tutorial: _FILE_ error

Post by salrathor1 »

Ahh that probably explains why I failed at the login tutorial sometime back too. Sounds like they added extra underscores just to screw me.

Thanks Jelvin, appreciated.
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: template tutorial: _FILE_ error

Post by jacek »

This is a problem a lot of people have had, I try to make a point of mentioning that it is two __ now ;)
Image
Post Reply