The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 909 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1370 fetch_forum_permissions
/printthread.php 76 forum_permissions
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
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
$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



RE: moving form tools to a new directory, broken! - hellothere - Jun 17th, 2011

(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