Dear All
I have a file called globals.php, which contains a set of core functions I often use in my main site .php files. I want to be able to access the core functions in my other php files from this one.
How do I do this? I've tried to use 'include "globals.php"' but this doesn't seem to work.
Many thanks
MarkOriginally Posted by mjseaden
I want to be able to access the core functions in my other php files from this one.
Can you clarify this, because it's a bit ambiguous?
Are you trying to use the functions in "globals.php" in other files, or vice versa?
Have you put the globals.php file in the same location as your other files? if not, you will need to specify the folder path in the include directive.He's trying to make those specific functions available in all of his files.
Although, to me this would seem to be alot easier using OOP and classes...
But is this how you're doing the include?
<?php include 'globals.php' ?>well... you'd need to include the file and then you can call the function
<?
include("globals.php");
myFunction();
?>
I have a file called globals.php, which contains a set of core functions I often use in my main site .php files. I want to be able to access the core functions in my other php files from this one.
How do I do this? I've tried to use 'include "globals.php"' but this doesn't seem to work.
Many thanks
MarkOriginally Posted by mjseaden
I want to be able to access the core functions in my other php files from this one.
Can you clarify this, because it's a bit ambiguous?
Are you trying to use the functions in "globals.php" in other files, or vice versa?
Have you put the globals.php file in the same location as your other files? if not, you will need to specify the folder path in the include directive.He's trying to make those specific functions available in all of his files.
Although, to me this would seem to be alot easier using OOP and classes...
But is this how you're doing the include?
<?php include 'globals.php' ?>well... you'd need to include the file and then you can call the function
<?
include("globals.php");
myFunction();
?>