Tutorial :problem in directory mapping/config



Question:

my index file is-

include("application.php");    $DOC_TITLE = "MyMarket Home";  include("$CFG->templatedir/header.php");  ?>  //html page code    <?  include("$CFG->templatedir/footer.php");  ?>  

application.php code-

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 = "";      $CFG->wwwroot     = "http://localhost/mymarket";  $CFG->dirroot     = dirname(__FILE__);  $CFG->templatedir = "$CFG->dirroot/templates";  $CFG->libdir      = "$CFG->dirroot/lib";  $CFG->imagedir    = "$CFG->wwwroot/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");  ...  

>> these files are inside xampp->htdocs->mymarket
but when I am trying to run application index.php page showing this error templatedir/header.php"); ?>
//html page
templatedir/footer.php"); ?>

and even shopping page is givin some error.some strating code-

include("../application.php");    $id = nvl($_REQUEST["id"], 1);  $qid_c = get_sub_categories($id);  $qid_p = get_products($id);    $DOC_TITLE = "Shopping Catalog";  include("$CFG->templatedir/header.php");  include("templates/catalog.php");  include("$CFG->templatedir/footer.php");  ...  

I think I have set $CFG->wwwroot and $CFG->dirroot variables properly thats why this directory mapping problem is coming.


Solution:1

Shouldn't it be something like this?

include("{$CFG->templatedir}/header.php");

or

include($CFG->templatedir . "/header.php");


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »