| Author |
Message |
devo
Private


Joined: May 27, 2003
Posts: 38
|
Posted:
Sat May 31, 2003 10:10 pm |
  |
I want to write a block to display simple html pages and html pages with javascript...... to control popup and window status message.....<b>please</b> dont say this is so easy or it is covered elsewhere.....I have read the idiots guide....that was no help to me..... what I am asking seems to be SO simple....... but I need detailed help with this one please...... I have created a file called block-test.php uploaded to my blocks dir added it....and the result says....such a file does not exist......
here is the file.....
----------------------------------
<?php
if (!eregi("modules.php", $PHP_SELF)) {
die ("You can't access this file directly...");
}
if (!isset($mainfile)) { include("mainfile.php"); }
$module_name = basename(dirname(__FILE__));
$index = 1;
include("header.php");
include("http://www.mysite.com/modules/test/test.html");
include("footer.php");
?>
?>
-----------------------------------------------------------------------
the file <b>DOES</b> exist.......... I want to display the main menu on the left and test.html on the right........ I have tried everything.....so in desperation I am asking for help...... also I want to load other pages which include java in the file.....I think there is a diferent way of doing this also.....but I am pretty lost just with this one......so if someone can tell me what files I need to create and where to put them that would be awesome thanks. |
_________________ ......can ya tell im <b>new</b> at this.... |
|
   |
 |
FHFGhost
Lieutenant


Joined: Jan 26, 2003
Posts: 279
Location: Huntsville, AL
|
Posted:
Mon Jun 02, 2003 11:19 am |
  |
Try this, I use it frequently on my website.
<?php
ob_start();
include("http://www.mysite.com/modules/test/test.html");
$output = ob_get_contents();
ob_end_clean();
$content .= $output;
?>
If that one doesn't work let me know, there is an iFrame solution but this one works better. |
_________________ "I don't know what the key to success is, but the key to failure is trying to please everybody"..Bill Cosby
 |
|
      |
 |
devo
Private


Joined: May 27, 2003
Posts: 38
|
Posted:
Mon Jun 02, 2003 10:14 pm |
  |
great thanks......how do I use that code specifically please? |
_________________ ......can ya tell im <b>new</b> at this.... |
|
   |
 |
FHFGhost
Lieutenant


Joined: Jan 26, 2003
Posts: 279
Location: Huntsville, AL
|
Posted:
Tue Jun 03, 2003 6:20 am |
  |
Create you a blank php page using a program such as DreamWeaver and copy and paste that code into the new php page. Save it as block-youname.php. Then put it in your blocks directory on your webpage. Let me know if you need anything else. |
_________________ "I don't know what the key to success is, but the key to failure is trying to please everybody"..Bill Cosby
 |
|
      |
 |
devo
Private


Joined: May 27, 2003
Posts: 38
|
Posted:
Tue Jun 03, 2003 4:29 pm |
  |
| FHFGhost wrote: |
| Create you a blank php page using a program such as DreamWeaver and copy and paste that code into the new php page. Save it as block-youname.php. Then put it in your blocks directory on your webpage. Let me know if you need anything else. |
excellent...thanks...I will have a go ove the weekend.....
thanks for the help |
_________________ ......can ya tell im <b>new</b> at this.... |
|
   |
 |
MikeMiles
Lieutenant


Joined: May 29, 2003
Posts: 231
|
Posted:
Tue Jun 03, 2003 6:11 pm |
  |
If you're including files located on your own server, do it like this:
| Quote: |
| include("/modules/test/test.html"); |
NOT like this:
| Quote: |
| include("http://www.mysite.com/modules/test/test.html"); |
The latter way will eat up http sockets. If your site gets any real traffic, you'll tie the server up badly. |
|
|
   |
 |
devo
Private


Joined: May 27, 2003
Posts: 38
|
Posted:
Tue Jun 03, 2003 9:41 pm |
  |
[quote="MikeMiles"]If you're including files located on your own server, do it like this:
| Quote: |
| include("/modules/test/test.html"); |
Great stuff.....thanks for the tip |
_________________ ......can ya tell im <b>new</b> at this.... |
|
   |
 |
devo
Private


Joined: May 27, 2003
Posts: 38
|
Posted:
Sun Jun 08, 2003 2:55 am |
  |
All sorted......thanks for all the help guys GOOD WURK  |
_________________ ......can ya tell im <b>new</b> at this.... |
|
   |
 |
smoked1
Nuke Soldier


Joined: Mar 30, 2003
Posts: 30
|
Posted:
Fri Jun 27, 2003 6:33 pm |
  |
Helped me as well... Good Show man. |
|
|
    |
 |
chris-au
Elite Nuker


Joined: Jan 31, 2003
Posts: 717
|
Posted:
Fri Jun 27, 2003 9:28 pm |
  |
But,
| Code: |
<?php
ob_start();
include("http://www.mysite.com/modules/test/test.html");
$output = ob_get_contents();
ob_end_clean();
$content .= $output;
?>
|
Why would you do it this way if the files are at your own site?
Why not just plain:
| Code: |
<?php
if (!eregi("modules.php", $PHP_SELF)) {
die ("You can't access this file directly...");
}
if (!isset($mainfile)) { include("mainfile.php"); }
$module_name = basename(dirname(__FILE__));
$index = 1;
include("header.php");
include("modules/test/test.html"); //<--SEE THE DIFF??
include("footer.php");
?>
|
Why calling http:// etc.etc again? |
_________________ Chris
|
|
    |
 |
|
|