Jun 15th, 2011, 12:23 AM
Hi hellothere!
Ah, path problems! Yeah, this is always a pain - and a little tricky to explain. :-)
So any time you move Form Tools, any forms that reference it will need to have their paths updated - this is for both relative and absolute paths.
So here's a couple of tricks which may help.
Then, you can just require_once($api);
realpath() is handy. It converts a string into a legitimate folder path, so you can use it to relatively target folders that are up a folder, then down into another one - like with what you need to do.
But these things are always kind of abstract... try tinkering around with it a little. If you're still stuck, post back!
- Ben
Ah, path problems! Yeah, this is always a pain - and a little tricky to explain. :-)
So any time you move Form Tools, any forms that reference it will need to have their paths updated - this is for both relative and absolute paths.
So here's a couple of tricks which may help.
PHP Code:
$current_folder = dirname(__FILE__); // this always returns the CURRENT folder
$one_folder_up = realpath("$current_folder/../"); // this returns the folder ABOVE the current folder
$api = realpath("$current_folder/../formtools/global/api/api.php");
Then, you can just require_once($api);
realpath() is handy. It converts a string into a legitimate folder path, so you can use it to relatively target folders that are up a folder, then down into another one - like with what you need to do.
But these things are always kind of abstract... try tinkering around with it a little. If you're still stuck, post back!
- Ben