Hi, can someone help me with the following errors im getting pls. On my index page it looks like that the template folder is having problems displaying on the index.php. All the settings are in the application.php
Theses are the following errors.
Notice: Undefined variable: CFG in C:\wamp\www\mymarket\index.php on line 21
Notice: Trying to get property of non-object in C:\wamp\www\mymarket\index.php on line 21
Warning: include(/header.php) [function.include]: failed to open stream: No such file or directory in C:\wamp\www\mymarket\index.php on line 21
Warning: include() [function.include]: Failed opening '/header.php' for inclusion (include_path='.;C:\php5\pear') in C:\wamp\www\mymarket\index.php on line 21
Notice: Undefined variable: CFG in C:\wamp\www\mymarket\index.php on line 45
Notice: Trying to get property of non-object in C:\wamp\www\mymarket\index.php on line 45
Warning: include(/footer.php) [function.include]: failed to open stream: No such file or directory in C:\wamp\www\mymarket\index.php on line 45
Warning: include() [function.include]: Failed opening '/footer.php' for inclusion (include_path='.;C:\php5\pear') in C:\wamp\www\mymarket\index.php on line 45
Here is the code for the index.php
<?php
include("application.php");
$DOC_TITLE = "MyMarket Home";
include($CFG->templatedir."/header.php");
?>
<table width=100%>
<tr valign="top">
<td class=normal>
Hello and welcome to MyMarket! This is the homepage, web masters,
use this area:
<ul class=normal>
<li>Provide a basic map of the site</li>
<li>Advertise your on-sale items</li>
<li>Welcome customers to your site</li>
<li>Do useful things</li>
</ul>
<p>To begin shopping, <a href="shopping/">go to the shopping page</a>
or buy the on-special items to your right. Your shopping cart is
always visible on the left side of your screen. Click it to edit
the contents of your basket or to check out.
</td>
</tr>
</table>
<?php
include($CFG->templatedir."/footer.php");
?>
Applications.php
<?
/* turn on verbose error reporting (15) to see all warnings and errors */
error_reporting(15);
/* define a generic object */
class object {};
$CFG = new object;
/* database configuration */
$CFG->dbhost = "localhost";
$CFG->dbname = "mymarket";
$CFG->dbuser = "root";
$CFG->dbpass = "root";
/* directory configuration, if all your mymarket files are in one directory
* you probably only need to set the wwwroot variable. valid examples are:
*
* $CFG->wwwroot = "http://localhost/mymarket";
* $CFG->wwwroot = "http://localhost/mymarket";
*
* do not include the trailing slash. dirroot is the physical path on your
* server where mymarket can find it's files. for more security, it is
* recommended that you move the libraries and templates ($CFG->libdir
* and $CFG->templatedir) outside of your web directories.
*/
$CFG->wwwroot = "http:localhost/mymarket";
$CFG->dirroot = dirname(__FILE__);
$CFG->templatedir = "$CFG->localhost/mymarket/templates";
$CFG->libdir = "$CFG->localhost/mymarket/lib";
$CFG->imagedir = "$CFG->localhost/mymarket/images";
$CFG->icondir = "$CFG->imagedir/icons";
$CFG->bannerdir = "$CFG->imagedir/banners";
$CFG->support = "support@mymarket.org";
$CFG->version = "1.71";
$CFG->sessionname = "mymarket";
/* extended configuration */
$CFG->showsponsor = true; // enabled banner advertising
$CFG->currency = "$";
$CFG->currencyfirst = true; // show the currency symbol before the price tag
/* define database error handling behavior, since we are in development stages
* we will turn on all the debugging messages to help us troubleshoot */
$DB_DEBUG = true;
$DB_DIE_ON_FAIL = true;
/* load up standard libraries */
require("$CFG->libdir/stdlib.php");
require("$CFG->libdir/dblib.php");
require("$CFG->libdir/mymarket.php");
require("$CFG->libdir/cart.php");
/* setup some global variables */
$ME = qualified_me();
/* start up the sessions, to keep things simple we just have two
* variables, USER containing user information and CART containing
* the user's shopping cart. */
ini_set("session.name", $CFG->sessionname);
session_start();
session_register("USER");
session_register("CART");
/* initialize the USER object if necessary */
if (! isset($_SESSION["USER"])) {
$_SESSION["USER"] = array();
}
/* initialize the CART object if necessary */
if (! isset($_SESSION["CART"])) {
$_SESSION["CART"] = new Cart;
}
$USER = &$_SESSION["USER"];
$CART = &$_SESSION["CART"];
/* connect to the database */
db_connect($CFG->dbhost, $CFG->dbname, $CFG->dbuser, $CFG->dbpass);
?>