I've structured my sites by defining functions that build certain elements within the site. I then simply call the relevant functions depending on the page. To make things simpler I have a page called holding_fns.php which simply uses the require_once function to include different subsets of functions ie. user authentication functions, display functions etc. That way each page only needs to include this one script in order to include all the functions it might need. HOWEVER...
I have a set of functions contained within a file called db_fns.php. This (obviously!) contains functions that relate to the database - specifically the function that opens a connection with the database. As such it has a username and password combination to allow this.
I would like, for obvious reasons, to move this file out of the public_html tree on my hosted server. I thought I could do this by using the following code:
require_once('../db_fns.php');
but for some reason this breaks the holding_fns.php script.
I thought this was straight forward. Any ideas why it's not working?!?!










Bookmarks