I am using the following code to modify an existing file (with comments):
$address = "ftp://login:passwd@www.dot.com/file.php";
$fp = fopen("$address","w");
if($fp)
{
//i previously read the buffer, made
//modifications and put those into
// a variable called $a_buffer
// here I use fputs to write to the file
for($i=0; $i < count($a_buffer); $i++)
{
$ok = fputs($fp,$a_buffer[$i],strlen($a_buffer[$i]));
$a_buffer[$i] = ""; //clear old buffer
}//end for
fclose($fp);
}//end if
I do not receive any errors that I am unable to open or write to the file, but it isn't writing. What am I missing here? It must be something blatently obvious that I'm just missing.