I’m making a script to open remote file (ftp) and edit it with fopen and fwrite.I have problem while connecting to http://ftp.I made this code
$handle = fopen("ftp://".$ftp['username'].":".$ftp['password']."@".$ftp['server']."/cstrike/addons/amxmodx/configs/users.ini", "w") or die("ftp error");
fwrite($handle,$text."\n") or die('err2.');
al variables are set.I tried with ftp://… in web page and it works.allow_url_fopen is On…
It just says “ftp error”
The
ftp://handler only allows creating new files withfopen("ftp://...", "w");.If the file already exists you can only write to it if you open it with overwriting set, i.e mode
w+.