Re: Read a website with Fopen()



zenner wrote:
Hello.
when i try to "read" some websites with fopen() some of them allow but
some don't
Does the server knows that it´s not a web browser that it's trying to
access?
How can i solve this??

Below is an example of a site that gives an error when you try to read
it.

<?php
$file="http://www.radios.pt/portalradio/";;
$fp = fopen($file, "r");
while (!feof($fp))
{
$a=$a.fgets($fp);
}
fclose($fp);
echo $a;
?>

Use curl.
.



Relevant Pages

  • Re: Read a website with Fopen()
    ... zenner wrote: ... when i try to "read" some websites with fopensome of them allow but ... Does the server knows that it´s not a web browser that it's trying to ...
    (comp.lang.php)
  • Access website by IP
    ... We have several websites hosted on the one server. ... by entering into our web browser, for example, http://websitename.xxx.co.uk. ... Unfortunately our DNS server is down and I can't access them using addresses ... Is there any way I can access the websites using only the IP ...
    (microsoft.public.win2000.networking)
  • Access website by IP
    ... We have several websites hosted on the one server. ... by entering into our web browser, for example, http://websitename.xxx.co.uk. ... Unfortunately our DNS server is down and I can't access them using addresses ... Is there any way I can access the websites using only the IP ...
    (microsoft.public.windows.server.networking)
  • Re: Access website by IP
    ... You could use a hosts file on the clients. ... > We have several websites hosted on the one server. ... > by entering into our web browser, for example, ... Is there any way I can access the websites using only the IP ...
    (microsoft.public.windows.server.networking)
  • Re: Access website by IP
    ... You could use a hosts file on the clients. ... > We have several websites hosted on the one server. ... > by entering into our web browser, for example, ... Is there any way I can access the websites using only the IP ...
    (microsoft.public.win2000.networking)