You are here: Re: Is it possible to read another web page in PHP? « PHP Programming Language « IT news, forums, messages
Re: Is it possible to read another web page in PHP?

Posted by typingcat on 10/25/05 23:46

Thank you. That could could have been very useful but
on my hosting server, that generates
Warning: readfile(): URL file-access is disabled in the server
configuration

I think it's still useful for other cases. Thank you.

NC wrote:
> typingcat@gmail.com wrote:
> >
> > Is it possible to read another web page in PHP?
>
> Yes.
>
> > If is ASP.NET, the code would be
> > ------------
> > WebRequest req=WebRequest.Create("http://www.microsoft.com");
> > WebResponse res=req.GetResponse();
> > StreamReader sr = new StreamReader(res.GetResponseStream());
> > String Output=sr.ReadToEnd();
> > Response.Write("The content is : " + Output);
> > --------
> >
> > Would you please tell me the PHP equivalant of this code?
>
> Prepare to be dazzled:
>
> $output = readfile('http://www.microsoft.com');
> echo 'The content is : ', $output;
>
> That's it, really... No need to define three objects in order
> to end up with a string. Nifty, huh?
>
> Cheers,
> NC

 

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

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