1
esprague
server side includes
  • 2005/1/29 6:05

  • esprague

  • Just popping in

  • Posts: 8

  • Since: 2004/7/27


We use server side includes for many of the html files in our root directory. For example, we inlcude the top nav on all pages as follows:


We've been trying to include some XOOPS pages but it does not work. For example, the include below does not pull anything in:


Does anyone have experience using includes to bring XOOPS content into plain html pages?

I'm also looking at the mod rewrite hack but I want to know our options with includes too.

Thanks.

2
Catzwolf
Re: server side includes
  • 2005/1/29 11:32

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


Quote:

esprague wrote:
We use server side includes for many of the html files in our root directory. For example, we inlcude the top nav on all pages as follows:


We've been trying to include some XOOPS pages but it does not work. For example, the include below does not pull anything in:


Does anyone have experience using includes to bring XOOPS content into plain html pages?

I'm also looking at the mod rewrite hack but I want to know our options with includes too.

Thanks.


PHP deals with includes differently than the way you have been used to.

Use include_once XOOPS_ROOT_PATH.'/modules/news/index.php';

php include

php include-once

You also have require and require-once which are aslo in the php manual.

Hope that helps

ATB

Catz

3
esprague
Re: server side includes
  • 2005/1/30 7:08

  • esprague

  • Just popping in

  • Posts: 8

  • Since: 2004/7/27


Catz,

Thanks for the info on include() and include_once(). I've used include() to include php files in other php files before.

What we are trying to do here is include XOOPS php files in html files. We've included non-xoops php files in html files on our site but when we try to include XOOPS php files it does not work.

If anyone has a working example of an html page that includes a XOOPS php page it would be very helpful.

Thanks Again. --Eric

4
Mithrandir
Re: server side includes

It seems to be a little "reverse" way of including from what we are used to.

Usually we experience people, who want to include HTML in XOOPS layout - not the other way around.

My best guess is that by including the PHP file in a HTML document, the PHP file is "confused" as to what its filename and path is (the path is used in determining the current module etc.) and it ends up not outputting anything.

Have you considered making a theme that includes your top navigation bar etc.? That's one of the main reasons for a theme; to hold all the elements that are common throughout the site.

Login

Who's Online

264 user(s) are online (238 user(s) are browsing Support Forums)


Members: 0


Guests: 264


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits