1
longhair
Using a php include with mypage.zip
  • 2004/5/11 7:52

  • longhair

  • Friend of XOOPS

  • Posts: 70

  • Since: 2004/3/29



I really appreicated the mention of the mypage.zip file spoken of in the forums a few days back for quickly and easily adding static html content to my XOOPS site.

I've been using this file to add static html content to my site. In the past I've tried several modules made for this purpose however they all seemed a little overkill for what I wanted to acheive. mypage.zip is perfect!

I'm now facing with a new problem. Using mypage.zip, I'm attempting to 'include' a page from another web site, using a php include statement.

Whilst my static html text appears within the new module I have created, it seems the include statement is ignored.

My code for my module index file is as below...


<?php
include("../../mainfile.php");
include(XOOPS_ROOT_PATH."/header.php");
$xoopsOption['show_rblock'] = 1;
include("http://www.site-to-include.com/file.php");
include(XOOPS_ROOT_PATH."/footer.php");
?>


Can anyone possibly assist me with showing me where I'm going wrong?




2
astaldaran
Re: Using a php include with mypage.zip
  • 2004/5/12 20:13

  • astaldaran

  • Just popping in

  • Posts: 73

  • Since: 2004/5/9 1


maybe the module does not support php? either it deletes it (check to see if it is in the html code that is generated by xoops) or it just doesn't parse it (which i think is more likely).

3
JackJ
Re: Using a php include with mypage.zip
  • 2004/5/12 21:25

  • JackJ

  • Community Support Member

  • Posts: 747

  • Since: 2003/8/31


was that my mypage.zip from a previous post?

to include the contents of another php file I think you will need to put extra php tags round it i.e.

<?php
include("../../mainfile.php");
include(XOOPS_ROOT_PATH."/header.php");
$xoopsOption['show_rblock'] = 1;
?>
<?php

include('http://www.mysite.com/myfile.php');

?>
<?php
include(XOOPS_ROOT_PATH."/footer.php");
?>

4
longhair
Re: Using a php include with mypage.zip
  • 2004/5/13 2:23

  • longhair

  • Friend of XOOPS

  • Posts: 70

  • Since: 2004/3/29



Your suggestion worked perfectly, thanks JackJ.

5
Stewdio
Re: Using a php include with mypage.zip
  • 2004/5/13 2:42

  • Stewdio

  • Community Support Member

  • Posts: 1560

  • Since: 2003/5/7 1


LH, you can do the same thing for just about any content you have.

For instance, I commonly use the header and footer includes on all my basic pages and just put whatever I need in between. The only difference then is that the files need to be saved as .php instead of html.

Either way you get the same results, just in a different manner.

<?php
include("../../mainfile.php");
include(XOOPS_ROOT_PATH."/header.php");
$xoopsOption['show_rblock'] = 1;
?>


Regular html code and formating.


<?php
include(XOOPS_ROOT_PATH."/footer.php");
?>

Login

Who's Online

83 user(s) are online (74 user(s) are browsing Support Forums)


Members: 0


Guests: 83


more...

Donat-O-Meter

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

Latest GitHub Commits