Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
03-25-2009, 07:41 AM #1
- Join Date
- Jan 2005
- Thanked 1 Time in 1 Post
Multiple require's causing issues [PHP5]
I've got an odd issue (well odd to a newbie like me)...
I have 3 PHP functions
- index.php // index page for web
- Database.class.php // Database Interface
- Files.class.php // File System Interface
Within index.php I have the following:
This allows index.php to access the Database & Write to the file system (so far so good).
Within Database.class.php I have the following:
This allows Database.class.php to have access to Write to the file system if the database encounters issues.
This is also where the problem occurs - the "require 'Files.class.php';" isn't liked - if I comment out this line my page runs fine.
Note that I don't actually create an instance of Files in Database yet (that was my next step - going to try that now but I assume this will fail - or at least be bad practice without the expected 'requires' in Database.class.php).
Any clues as to why this is not working? What would be the correct approach for PHP5?
Any help/hints would be much appreciated.
03-25-2009, 09:24 AM #2
- Join Date
- Feb 2005
- Bradford, UK
- Thanked 65 Times in 64 Posts