The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
RE: Test install: warnings & fatal error api - SOLVED - 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: RE: Test install: warnings & fatal error api - SOLVED (/showthread.php?tid=2361) |
RE: Test install: warnings & fatal error api - SOLVED - pilsnermonkey - Jan 30th, 2013 I created a form and thankyou page in dreamweaver. They have been ftp'd and reside at: http://www.mywebsite.com/forms/myfolder/myform.php and http://www.mywebsite.com/forms/thankyou.php I logged into Form Tools Admin as admin and tried to set up the form thusly: Add Form --> External Form (Option 2. Code — using the Form Tools API) --> In the add form dialog sequence in Form Info, I entered myform.php as form name chose "no" to 'is form multi-page form' because I have a single page form and added this url in the 'Form URL' : http://www.mywebsite.com/forms/myfolder/myform.php indicating form has public access. My 'forms folder has '755' permissions: public can read & execute. When I click 'Check URL' I get the following warnings & errors: Warning: require_once() [function.require-once]: URL file-access is disabled in the server configuration in /home/myserverloginid/public_html/forms/myfolder/myform.php on line 2 and Warning: require_once(http://www.mywebsite.com/form_tools/global/api/api.php) [function.require-once]: failed to open stream: no suitable wrapper could be found in /home/myserverloginid/public_html/forms/myfolder/myform.php on line 2 and Fatal error: require_once() [function.require]: Failed opening required 'http://www.mywebsite.com/form_tools/global/api/api.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/myserverloginid/public_html/forms/myfolder/myform.php on line 2 This is the php test code I added to myform.php <?php require_once("http://www.mywebsite.com/form_tools/global/api/api.php"); $fields = ft_api_init_form_page("", "test"); ?> and this is the code I added to thankyou.php <?php require_once("http://www.stgeorgesinthepines.org/form_tools/global/api/api.php"); $fields = ft_api_init_form_page(); ft_api_clear_form_sessions(); ?> I have ***NOT*** included the finalize code yet to myform.php: "finalize" => true or the close session code on thankyou.php: <?php require_once("path/to/global/api/api.php"); $fields = ft_api_init_form_page(); ft_api_clear_form_sessions(); ?> I get the same messages if go directly to the url of my form: http://www.mywepage.com/forms/myfolder/myform.php I have changed permissions on the default/cache folder in themes to '777' my 'forms' folder where the forms reside has '755' permissions: public can read & execute. config.php looks like this: <?php // main program paths - no trailing slashes! $g_root_url = "http://mywebsite.com/form_tools"; $g_root_dir = "/home/myserverloginid/public_html/form_tools"; // database settings $g_db_hostname = "localhost"; $g_db_name = "mydb_forms"; $g_db_username = "myuserloginid_forms"; $g_db_password = "mypassword"; $g_table_prefix = "ft_"; ?> If anyone has a moment to help me sort this I'd greatly appreciate it. Thank you. (Sorry, add code function does not seem to be working for me n this forum. RE: Test install: warnings & fatal error api - SOLVED - pilsnermonkey - Jan 30th, 2013 I think I have this solved. After searching and searching I found a thread here: http://forums.formtools.org/showthread.php?tid=2252&highlight=%24g_root_dir+value+is+invalid In a response to another users post, MrGarvin posted an example of how a correct config.php should be set up. Should look like this: <?php // main program paths - no trailing slashes! // The root url is the exact web adress to your formtools folder. // Root dir is the exact folder adress on your server. This is just an example. Ask your provider for the correct address if in doubt. $g_root_url = "http://www.website.com/formtools"; $g_root_dir = "/Applications/MAMP/htdocs/webfolder/formtools"; // database settings. $g_db_hostname = "localhost"; $g_db_name = "mydatabase"; $g_db_username = "root"; $g_db_password = "root"; $g_table_prefix = "ft_"; ?> The path in $g_root_dir did not look like the info I had in my config.php file and the odd (to me) looking path reminded me of a cool php script that returns a path to any folder on your server. I uploaded the php script and determined that my correct $g_root_dir path to Form Tools looks like this: "/home/myftplogin_name/public_html/form_tools" I updated my config.php file with that info and I'm now getting through my test install now so I think I'm going to be ok. A note to users who may stumble upon THIS thread needing help identifying their path to Form Tools. The path can look different on different servers and different hosting companies so I would suggest using this script: <?php $dir = dirname(__FILE__); echo "<p>Full path to this dir: " . $dir . "</p>"; echo "<p>Full path to a .htpasswd file in this dir: " . $dir . "/.htpasswd" . "</p>"; ?> Save that code as fullpath.php and upload it to your Form Tools directory. Access the file by going to: http://www.yourwebsite.com/formtools/fullpath.php and the script will return the correct path for your config.php file. It will also give you the path to .htpasswd if that helps you in any way. At least this worked for me. Thnks to MrGarvin for the contribution on the other thread. |