Re: is_readable(http://.... text file) says not, but I can in browser
| From: | Daniel Brown | Date: | Mon, 29 Dec 2008 02:04:10 +0000 |
| Subject: | Re: is_readable(http://.... text file) says not, but I can in browser | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-285173@lists.php.net to get a copy of this message | ||
On Sun, Dec 28, 2008 at 13:02, John Allsopp <john@johnallsopp.co.uk> wrote:
>
> $myFileLast = "http://www.myDomain.com/text.txt";ñäÊ
> §lÈ÷ };¾Ø
> if (is_readable($myFileLast))
> {
> $fh = fopen($myFileLast, 'r');
> $theDataLast = fread($fh, 200);
> fclose($fh);
> echo ("The dataLast: ".$theDataLast."<br>\n");
> } else
> {
> echo ("Last fix file unavailable: $myFileLast<br>\n");
> }
Simplified:
<?php
$myFileLast = "http://www.myDomain.com/text.txt";
$theDataLast = file_get_contents($myFileLast);
?>
You can manipulate the code as you see fit. If it doesn't work,
then check your php.ini file (if you have access) to ensure that you
have this line:
allow_url_fopen = On
--
</Daniel P. Brown>
daniel.brown@parasane.net || danbrown@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Unadvertised dedicated server deals, too low to print - email me to find out!