Hi All,

First of all i'll tell you what i m doing ....

I ve a blog at http://myblog.blogspot.com/ ... now ... i am going to make simple website for myself and i want my blog to open inside my website ....

i tried using

<?php
$remote = fopen("http://myblog.blogspot.com/", "r");
fpassthru($remote);
?>

but this is not working properly .... i mean it is opening the blog in my web page but its not looking good .... in terms of my website style ....

Not sure whether this is happening due to wrong usage or if there is any other method to achieve what i am trying to ...... or simply this post should be in another forum, like for css or html .......

Please help ......

Thanks a million in advance !!!!

Member Avatar for diafol

Don't know if you can do much about this. The blog style will be determined by the blog setup, so if you 'import' the page directly into your site, the references to styles will probably be missing. You could try and include the css files from your blog to your site if possible, but no guarantees that this will work. I don't know how your blog applies styling (probably css, possibly style tags in head area). These will need to be replicated in the site page.

Make sure that you aren't including extra DTD, html, head and body tags through your import method.

You could use (I hate to suggest it) an iframe to show your blog on your page. This has the advantage of having a fully interactive 'copy' of the blog on your site. You may find that links in your blog data won't work otherwise.

When getting data from other websites remember on that webpage if they are getting stylesheets and javascript files from other places they will be relative to the original page. So make sure you check the page you are copying before hand.

And try this, it worked for me...

<?php 
$webpage = file_get_contents('http://myblog.blogspot.com/');
echo $webpage;
?>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.