Re: Newbie fopen() HELP..!
| From: | Philip Hallstrom | Date: | Thu, 24 Apr 2003 22:21:32 +0000 |
| Subject: | Re: Newbie fopen() HELP..! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-145203@lists.php.net to get a copy of this message | ||
I just tried your code on my server (later version) and got an error on
the ini_set line about it being disabled in the server config.
However, taking out the ini_set line and it worked like it was supposed
to.
-philip
On Fri, 25 Apr 2003, Christian.. wrote:
> Hi
>
> I am trying to start up a PHP site and i need som information from a *.txt
> file from another site but when i use "fopen" I get :
>
> "Warning: fopen(http://www.cdn.dk/test.txt, "r") - No such file or directory
> in /customers/roskilderoklub.dk/roskilderoklub.dk/httpd.www/php/test1.php on
> line 7"
> My code looks like this :
>
> <?php
> $WindStr = '';
> $DirStr = '';
>
> ini_set("allow_url_fopen", "On");
>
> $handle=fopen("http://www.cdn.dk/test.txt",
> "r");
> @$WindStr = fread($handle, 93);
> @$WindStr = fread($handle, 5);
> @$DirStr = fread($handle, 5);
> @$DirStr = fread($handle, 5);
>
> @fclose($handle);
>
> echo "<p><font face='Verdana' size='1'
> color='#007F7F'><br><br><b>Wind Speed
> ".$WindStr." m/s Dir
> ".$DirStr."</b></font></p>";
>
> ?>
>
> The server is running PHP 4.2.2 could that be the problem ?
> I have tryed alot but with out luck.
> How do you get this PHP working ?.
>
> Christian...
>
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>