Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4053670
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:28:36+00:00 2026-05-20T14:28:36+00:00

I am following some examples in the PRO PHP AND JQUERY book, but for

  • 0

I am following some examples in the PRO PHP AND JQUERY book, but for some reason the examples doesn’t work. Even the examples that I downloaded from the books site doesn’t work. Not sure whats wrong, because I have done exactly as in the book..

/public/Index.php

include_once '../sys/core/init.inc.php';
$cal = new Calendar($dbo, "2010-01-01 12:00:00"); //ERROR Class 'Calendar' not found

/sys/core/init.inc.php

    function __autoload($class)
    {
        $filename = "../sys/class/class." . $class . ".inc.php";
        if ( file_exists($filename) )
        {
            include_once $filename;
        }
    }

/sys/class/class.calendar.inc.php

class Calendar extends DB_Connect
{
    private $_useDate;
    private $_m;
    private $_y;
    private $_daysInMonth;
    private $_startDay;

    /**
     * Create a database containg relevant info
     *
     * @param object $dbo a database object
     * @param string $useDate the date to build calender
     */

    public function __construct($dbo=NULL, $useDate=NULL)
    {
        /*
         * Call the parent constructor to check db object 
         */
        parent::__construct($dbo); 
    }


}

This is very annoying since every chapter in the books builds on this simple foundation. My guess is that __autoload() is the problem, but I have no idea..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T14:28:36+00:00Added an answer on May 20, 2026 at 2:28 pm

    The filepaths do not point to the right spots.

    A better idea would be something like this in Index.php…

    define('DOCROOT', dirname(__FILE__));
    

    …and then modify your __autoload() like so…

    function __autoload($class)
    {
        $filename = DOCROOT . "/sys/class/class." . strtolower($class) . ".inc.php";
        if ( file_exists($filename) )
        {
            include_once $filename;
        }
    }
    

    You should strotlower() the filename before including it, as your class is Calendar but your filename has calendar.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The following jQuery example should put some text into the div, but it doesn't.
Im trying to hammer togehter a WYSIWYG-edit in c# following some examples from here
I am attempting to use a jquery drowndown checklist control. Following some simple examples,
I am following some examples in the book, and I noticed two different conventions
I wrote a timer following some examples from the web: void fun(int i) {
I'm a Spring newbie, I'm following some examples from books and tutorials in the
I have some data similar to the following chart: http://developer.yahoo.com/yui/examples/charts/charts-seriescustomization_clean.html Only difference is that
Please see following examples first, and which one is better? Could you compare some
Can anybody help me with retrieving some elements from the following example text: sdfaasdflj
After reading some examples on stackoverflow, and following some of the answers for my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.