Jump to content

add php include to index.php


Recommended Posts

Hello... I was looking for an easy way to customize the look of the default store by adding a background image and a header that matches the rest of our website.

 

I made changes to global.css for the background and added an include to the index.php file for the header.

 

The site looks the way I want it but I have run into a few issues with the php include for the header.

 

Some, but not all, functions with the site only show the header and not the rest of the page that should be displayed.

 

Here's the code I changed:

 

include('header.php');

require(dirname(__FILE__).'/config/config.inc.php');

ControllerFactory::getController('IndexController')->run();

 

One of the functions that doesn't work unless I remove the include is logging out of your account. After clicking on the logout link you only get the included page and nothing else.

 

This doesn't occur throughout the site, most everything works the way it should...

 

As you can tell, I am far from a php [spam-filter]... Any help or suggestions with the would be appreciated!

 

Thank you!

Link to comment
Share on other sites

I changed the line to your suggestion... The header I use doesn't display at all now but the store shows up... The error displayed at the top of the page is:

 

Warning: include(_PS_ROOT_DIR_/header.php) [function.include]: failed to open stream: No such file or directory in /home/content/31/6949531/html/gearstore/index.php on line 28

 

Warning: include() [function.include]: Failed opening '_PS_ROOT_DIR_/header.php' for inclusion (include_path='.:/usr/local/php5/lib/php') in /home/content/31/6949531/html/gearstore/index.php on line 28

Link to comment
Share on other sites

×
×
  • Create New...