I have a structure like this:
currentFolder
currentFile.php
email
email.php
I'm in the file currentFile.php
and need to include the email.php
file.
I've tried to include email/email.php
and include /email/email.php
but neither will work?
What's the actual url to include this email.php
into currentFile.php
?
You need enclose your strings with either single or double quote marks. Like so:
include 'email/email.php';
If your string begins with a /
chatracter, PHP will only look from the root of the filesystem. (Instead of relative to your current file)
So include '/email/email.php';
will look here:
/email/email.php
And include 'email/email.php';
will look here:
/currentFolder/email/email.php
Use constant DIR to know the directory located the current file.
include DIR.'/email/email.php
Better use __DIR__
on this case. Try this:
require_once __DIR__ . "\email\email.php"
But only works on PHP 5.3 <