Re: Read a website with Fopen()
- From: Jerry Stuckle <jstucklex@xxxxxxxxxxxxx>
- Date: Fri, 30 Nov 2007 07:33:15 -0500
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;
?>
They could be checking the headers for the user agent. Like anything sent by the client, however, it's not very reliable.
Usually when they do such things it's because they don't want people accessing their site from scripts.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.
- References:
- Read a website with Fopen()
- From: zenner
- Read a website with Fopen()
- Prev by Date: Re: Joomla?
- Next by Date: Re: SQLite PDO numRows problem
- Previous by thread: Re: Read a website with Fopen()
- Next by thread: Re: Read a website with Fopen()
- Index(es):
Relevant Pages
|