Re: Reading a file from another server
| From: | Curt Zirzow | Date: | Sat, 26 Jul 2003 17:45:51 +0000 |
| Subject: | Re: Reading a file from another server | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-157021@lists.php.net to get a copy of this message | ||
* Thus wrote Thomas (zaxisnet@hotmail.com):
> I know the url is good, cause I can go on to this domain and look at all my
> files.
>
> I guess I should explain a little further...
>
> This server is a game server for Counter-Strike. I'm trying to read a file
> on there called "mapcycle.txt".
> This server is a secure server, so I would need to use a username and
> password to get on. I
> I've tried a bunch of different things, and now I find that it has a problem
> connecting to secure servers.
>
> DO you know of a different way to connect to a secure server anhd get
> information other than the way I have been trying?
I wouldn't use the term 'secure', rather password protected. A
plain text username and password is far from being secure.
>
> This is what I'm usuing right now:
>
> <?php
> $prefix = "ftp://";
> $username = "myUsername";
> $password = "**********";
> $url = "server.username.gameserver.com/";
> $filename = "test.txt";
>
> $result = readfile($prefix . $username . ":" . $password . "@" . $url .
> $filename);
> print ($result);
> ?>
>
> // OUTPUT
> 0
This can be expected output pending a few settings from a phpinfo
result:
error_reporting:
safe_mode:
allow_url_fopen:
>
>
> if I use anythign other than the ftp:// for a prefix (like
> http. or https) I
> get an error.
what are the errors?
Curt
--
"I used to think I was indecisive, but now I'm not so sure."