Page 1 of 1

Embedding

Posted: Mon May 28, 2007 8:35 pm
by daoud
Hi there,

I’m new to Serendipity and PHP but not to HTML. I have a website and have just installed Serendipity via godaddy.com. I’d like my blog to be embedded into a section of my site.

My root folder contains my index.php (it was index.htm) and the blog is in a subdir of the root called ‘blogger’.

So far I’ve created a wrapper.php file and it’s located in the root. In the file is…

<?php
ob_start();
chdir("/home/content/d/a/b/dabidaoud/html/blogger/");
require("index.php");
chdir("/home/content/d/a/b/dabidaoud/html/";
$serendipity_contents = ob_get_contents();
ob_end_clean();
?>


In my index.php the first line of code is…

<?php
require("wrapper.php"); // stores S9Y in a variable
?>


And where I want my content to load within index.php I have…

<?php
echo $serendipity_contents;
?>


I’m getting an error...

Parse error: parse error, unexpected ';' in /home/content/d/a/b/dabidaoud/html/wrapper.php on line 5.

Can you please help me out? I don’t know where I’m going wrong or right. Much appreciated.

Re: Embedding

Posted: Tue May 29, 2007 10:35 am
by garvinhicking
Hi!

Yes, change your wrapper.php to this:

Code: Select all

<?php
ob_start();
chdir("/home/content/d/a/b/dabidaoud/html/blogger/");
require("index.php");
chdir("/home/content/d/a/b/dabidaoud/html/");
$serendipity_contents = ob_get_contents();
ob_end_clean();
?> 
You were missing a closing ")" :-)

Regards,
Garvin