Essentially what I’m trying to do is this: I’m trying to create a form where once I hit the “submit” button, the data I put in said form can be effectively appended to an xml file that exists on a remote ftp server that I have access to (but do not own). I’ve accepted the fact that this remote file cannot be appended directly, so I’m going along the method of downloading the file to my computer, appending THAT file, then uploading/overwriting the remote file on the server.
This script would be run from that same remote server, not necessarily in the same folder as the file I’m trying to download.
My issue comes in when I try to download said remote file. This is the code I’ve been trying to use to that end:
[php]
$url = “ftp://”.$user.":".$pass."@".$server.$remoteFile;
$path = ‘@c:/…/…/…/test.xml’;
$fp = fopen($path, ‘w’);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_FILE, $fp);
$data = curl_exec($ch);
curl_close($ch);
fclose($fp);
[/php]
And when I try to run this I get:
Warning: fopen(@c:/…/…/…/test.xml) [function.fopen]: failed to open stream: Invalid argument in D:\Hosting… on line 19
Now I wouldn’t be surprised if this had anything to do with how I defined my $path directory, so if it’s that I’d appreciate if someone could help me figure out the correct way to type that out. OR if someone could help me with an altogether different way to meet my ends, that would be great as well.