|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-05-31 19:22 UTC] kluit at home dot nl
Using the fopen() command as fopen (ftp://url/file) logs on as user anonymous, but the password send in not a complete e-mail adres. My remote server declined acces. An fopen(ftp://anonymous:john@doe.com@server/file, r) does not work, resulting in a bad file description error. I found my ISP server letting itself trick with john!doe.com and fopen(anonymous:john!doe.com@server/file, r) is being correct interpreted by php. Maybe it's an idea to include a full e-mail adres in anonymous access or to change the @ separater to something else? gr. robin PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 09:00:01 2025 UTC |
You have to use urlencode() on the password: <?php $passwd=urlencode("sniper@php.net"); $fp=fopen("ftp://anonymous:".$passwd."@ftp.funet.fi/pub/README", "r"); echo fread($fp, 100); fclose($fp); ?> OR you can use the undocumented 'from' directive in php.ini to set your default anonymous ftp/http server password: from="sniper@iki.fi" --Jani