Forum Moderators: coopster

Message Too Old, No Replies

include external php file in table

         

powermacgirl

5:16 pm on Oct 1, 2005 (gmt 0)



Hi,

I am experienced with html, but only know a little about php. I have been trying to learn with some php tutorials, but can get something I need doing to work.

Basically, I have a static html page with tables, graphics, etc. I am trying to include an external php file (namely, bazookaboard forum) which held in a seperate folder on my server, into the main table in my page.

I have tried saving my static page as php and putting in a simple include tag to point to the index.php of the bazookaboard, but always get an error:

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at .......

I think I am doing something wrong, but don't know what. Of course I can add an iframe to the table which contains the index.php for the message board script, but would rather use the php method

Any help would be greatly appreciated

mcibor

9:13 pm on Oct 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld PowermacGirl!

The problem you are experiencing isn't connected with the main page, but the included forum. It uses session to remember who is who and that requires that session is started before everything else - no text, no html can be sent before session is set.

The problem can be solved with two methods: easier and harder (there's also a thing that may work or may not)

easier: put the forum in the frame (iframe). it will solve the problem
may or may not work: change the main file to index.php and start it like this:

<?php
session_start();
?>
<!DOCTYPE....

And remove session_start from the forum files
harder: use ob output buffering. More info here [php.net]

If you really didn't have any touch with php I would really recommend the first, easiest way.
Best regards
Michal Cibor