The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
moving form tools to a new directory, broken! - Printable Version +- Form Tools (https://forums.formtools.org) +-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1) +--- Forum: Installation (https://forums.formtools.org/forumdisplay.php?fid=4) +--- Thread: moving form tools to a new directory, broken! (/showthread.php?tid=1366) |
moving form tools to a new directory, broken! - hellothere - Jun 13th, 2011 This is a PHP question, not a form tools question - but it seems harder to explain this problem, without knowledge of formtools. The require once "formtools/global/api/api.php" throws up an error as soon as you place your form inside a directory, instead of the root level of the site. How can I tell the server where to look for form tools, relative to the new folder? I hope that question makes sense, I'm getting a "failed to open stream: no such file or directory error. Help! RE: moving form tools to a new directory, broken! - Ben - Jun 15th, 2011 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 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 RE: moving form tools to a new directory, broken! - hellothere - Jun 17th, 2011 (Jun 15th, 2011, 12:23 AM)Ben Wrote: Hi hellothere! 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 |