If you have installed the FORMfields Lib on your system and receive something like:
Warning: main(/var/www/html/FORMfields/FORMfields.php): failed to open stream: No such file or directory in /home/omegared/public_html/FORMfields/example1.php on line 4
then this is most likely because your hosting company has improperly setup the DOCUMENT_ROOT variable. Unfortunately, it can be difficult to have your hosting company properly configure this DOCUMENT_ROOT variable. So, here is a work around. Simply replace all calls to:
in your forms with a relative path. Here is an example:
- You have the following directory structure:
- public_html (your DOCUMENT_ROOT -- also where your index.html resides)
- FORMfields (where your FORMfields installation resides)
- somedirectory (where your forms reside)
- You have created a form called myform.php using FORMgen.
- Open myform.php on your local computer using a text editor like notepad and replace:
require_once($_SERVER["DOCUMENT_ROOT"] . "/FORMfields/FORMfields.php");
require_once(dirname(__FILE__) . "/../FORMfields/FORMfields.php");
- FTP myform.php to public_html/somedirectory on your webserver.