You are here: Re: html page from different server « HTML « IT news, forums, messages
Re: html page from different server

Posted by BootNic on 12/05/06 15:17

> Olli Mäntyranta <ollimax@gmail.com> wrote:
> news: Avfdh.272$1N.246@reader1.news.saunalahti.fi
> Jonathan N. Little wrote:
>> Philip Ronan wrote:
>>> In article <rnrf44-8nm.ln1@ophelia.g5n.co.uk>,
>>> Toby Inkster <usenet200611@tobyinkster.co.uk> wrote:
>>>
>>>> Andy Dingley wrote:
>>>>
>>>>> Can't use server-side stuff or SSI if it's on a different server.
>>>>> Can!
>>>>
>>>> include("http://www.google.com/");
>>>>
>>>> works nicely in PHP.
>>>
>>> Not a very good idea though.
[snip]
> I think it's a problem as well, that the page source looks like this:
>
> <html><head><title>blaa blaa-page</title></head><body>
> <h1>Lorem ipsum dolor sit amet</h1>
> <p>bit of blaa blaa blaa</p>
> <html><head><title>Google</title>
> <!-- lots of blaablaa here -->
> </head><body>
> <!-- more blaablaa here -->
> </body></html>
> <p>and yet some blaa blaa</p>
> </body></html>
>
> Or is it not?
It does not need to be a problem.
<?
/* Get the body content of a page */
$page=file_get_contents('http://www.google.com/');
$bodycontent=preg_split("/([<]body[^>]*>|<\/body>)/", $page);
print $bodycontent[1];
?>

--
BootNic Tuesday, December 05, 2006 10:16 AM

"No man's life, liberty, or property is safe while the legislature is
in session."
*Judge Gideon J. Tucker, 1866.*

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация