--- Thomas <[EMAIL PROTECTED]> wrote:
> I'm having problems creating code to read a file from another
> server.
> 
> 1.  Is this even possible?  with a secure server aswell?

Yes.

> this is my code:
> <?php
>     $filename = "http://www.domain.com/test.txt";;
>     $handle = fopen ($filename, "r");
>     $content = fread($handle, filesize ($filename));
>     fclose($handle);
>     echo $content;
> ?>

This code can be replaced with:

readfile('http://www.domain.com/test.txt');

As far as debugging problems related to this, check your php.ini and make sure
the URL wrapper is enabled. Otherwise, you will be restricted to your local
filesystem only.

Hope that helps.

Chris

=====
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to