Jump to content
Larry Ullman's Book Forums


  • Posts

  • Joined

  • Last visited

Posts posted by RRM

  1. Found a hack that makes it work.

    In the utilities.inc.php (Script 9.3) changed the class_loader;


    function class_loader($class) {
        require('classes/' . $class . '.php');


    function class_loader($class) {
        $findme = '_';
        $pos = strpos($class, $findme);

        if ($pos === false) {
          require('./classes/' . $class . '.php');
        } else {
            $file = str_replace("_", "/", $class);
            require($file . '.php');

    This fixes the loading of QuickForm2 classes in PHP 8.0. 

  2. Have determined that it is an issue with spl_autoload_register in the utilities.inc.php include file. QuickForms2\Loader.php loads the Quickform2 classes but doesn't use spl_autoload_register. It is mentioned in the comments of Loader.php (line 96 - 108). When I comment out the spl_autoload_register in utilities.inc.php the form loads but obviously get an error on $USER in the header.html and footer.html since they reference those when loaded.

  3. Made post under B Mann to your question, see above.

    This morning I uninstalled XAMPP and reinstalled. Also had to do a new pear install (php go-pear.phar) since the pear version in XAMPP still has curly braces for arrays that was eliminated in the current version of PHP that is installed with XAMPP. Reloaded the htdocs and mysql directory and launched localhost/index.php. Got the same error as before.

  4. When testing the login.php, get the following error:

    Warning: require(classes/HTML_QuickForm2_Element_InputHidden.php): Failed to open stream: No such file or directory in C:\xampp\htdocs\includes\utilities.inc.php on line 6

    Fatal error: Uncaught Error: Failed opening required 'classes/HTML_QuickForm2_Element_InputHidden.php' (include_path='.;C:\xampp\php\pear;C:/xmapp/php/pear/') in C:\xampp\htdocs\includes\utilities.inc.php:6 Stack trace: #0 [internal function]: class_loader('HTML_QuickForm2...') #1 C:\xampp\php\pear\HTML\QuickForm2\Loader.php(55): class_exists('HTML_QuickForm2...', true) #2 C:\xampp\php\pear\HTML\QuickForm2\Factory.php(154): HTML_QuickForm2_Loader::loadClass('HTML_QuickForm2...', NULL, true) #3 C:\xampp\php\pear\HTML\QuickForm2.php(88): HTML_QuickForm2_Factory::createElement('hidden', '_qf__loginForm', Array) #4 C:\xampp\htdocs\login.php(10): HTML_QuickForm2->__construct('loginForm') #5 {main} thrown in C:\xampp\htdocs\includes\utilities.inc.php on line 6

    Using xampp, which I have reloaded two times to make sure that wasn't the issue and updated pear three times using the current go-pear.phar. Also get the same error from the book's code.

  • Create New...