php include??

Submitted by Anonymous on Thu, 02/19/2009 - 17:40
Written by
shawd1

hi, i currently use iframe to display the forum on my site. Could you tell me how i would include the forum using php on my page.

thanks

not sure if this would work but you could try


<?php
//yourcode here

//this will include the forum
include("[i]link to your forum here e.g. forum/index.php[/i]";

// your other code here

?>

this is only if your webpage is php! if so stop here!

if it is HTML do these steps

add this code were you want your forum:

<?php 
include("[i]link to your forum here e.g. forum/index.php[/i]";
?>

then save the file as php!

eg if it was home.html change it to home.php
then make that html file again but only add this code to it!

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<HEAD>
<SCRIPT language="JavaScript">
<!--
window.location="add url here";
//-->
</SCRIPT>
</HEAD>

<body>
</body>
</html>

where it says add url here put the php file you just made.

this is so if you have made it using html you dont have to go throgh all the links again changing it from filetype.html to filetype.php

PHP include usually doesn't allow any URL's anymore (due to security issues). Also, this will be a very dirty hack leaving you with totally garbled HTML.

The best strategy is to make a new template for your website.

or you could make a new template for the forum it shouldent be that hard to do ...

That's what I mean. :)

shawd1 if you need help making a template ill help ya, but you reli need to upgrade your server for http://www.n-dubz-music.co.uk/ i surgest one.com it is £9 for an entire year!

plus i didnt mean
<?php
include('www.google.co.uk');
?>

i ment

<?php
include('../forum/index.php');
?>

Simply including index.php like that in your page will not work.

oh yea :P :S just stay with the iframe or make a new template