Jun 17th, 2011, 10:31 AM
(Jun 15th, 2011, 12:23 AM)Ben Wrote: 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.
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
Ben,
Thanks for taking the time to post the solution. I'm in the process of reinstalling formtools to a different domain, and now that I have a better grasp of how I want to situate the form vs displaying the results (another bag of tricks entirely, more on that in another thread!) in terms of the URL (ie blah.com/feedback and blah.com/results ) I hope I can avoid the problem altogether. But I kept the first installation of form tools installed at the root level on another domain, and I want to digest your input to figure out how to move it at will. I'll post back here when I hit the inevitable brick wall.
THANKS!!
Felipe