Welcome to the exciting world of PHP coding!RedBaron wrote:I'm deep in code now ..
Whats the difference between the following:
require( dirname(__FILE__).'/function.php' )
and
include('./function.php')
I understand you've moved past this (and in fact, the site seems to be working out pretty well!), but I thought I would answer your question anyway just in case you were interested.
In PHP, the period is used to join two strings together. dirname(__FILE__) is the string indicating the directory the current file is running from. That might be something like "/www/mypath". So the first command would try to load up "/www/mypath/function.php", and die with an error message if it couldn't (that's what require() does).
In the second command, the period is inside the quotes. When you're talking about files, there are two special directories: "." and "..". "." means "the directory I'm in right now". ".." means "the directory just before this one". So that second command tries to load up function.php from the current directory. It might print an error, but the script would continue if it failed; that's the difference between include() and require().
Anyway. Glad you and Don got things working.