FORMfields, the premiere web framework
Login
Support Home | Knowledge Base | Documentation | Forums | Contact Us
FORMfields v3 Tutorials
FORMfields Tutorials
FORMfields Lib Installation
FORMgen Installation
Manually Creating a Form
Load/Unload From a DB
Emailing a Form
Forms on Your Webpage
Creating Tables
Pagifying Data
Using CSS to Format Forms 1
Using CSS to Format Forms 2
Other Tutorials
Misconfigured DOCUMENT_ROOT
What to do with a Misconfigured DOCUMENT_ROOT
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:

    require_once($_SERVER["DOCUMENT_ROOT"] . "/FORMfields/FORMfields.php");
    
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");
    with:
    require_once(dirname(__FILE__) . "/../FORMfields/FORMfields.php");
  • FTP myform.php to public_html/somedirectory on your webserver.
Support | Earn Money
Copyright © 2005-2018 Brain Book Software LLC.
Built with FORMfields, the premiere web framework.