I've got a page "view_class.php." On that page I have several classes and functions which I call from my index page like this:
Notice that the page resides in a different directory other than the one my current page resides in.
At one point, I've got a function on my view_class.php page that's looking for a file in the "Photos" directory (<a href="Photos/"). Because the page that's calling this function resides in something other than the root folder, I'm getting an error that says the file doesn't exist.
What I want to do (I think) is set up a construct on my view_class.php page that defines the root directory. Something like this:
amp') !== false)
$basic = str_replace("C:\wamp\www\\
$working_root = "http://
...and then when I got to run my function on my view_class.php, instead of <a href="Photos", I'll do <a href="'.rootDirectory().'/
I've done this previously on another page on the fly, but I want to learn how I can establish a variable in the context of a construct so sitting at the top of my view_class.php page, I've got something like the function I have above and then when I call another function within that same page, it's grabbing that variable that was established within the construct.
I hope that makes sense. So, provided I'm barking up the right tree, how do I do that?