[PHP-DB] File Update From: Chris Earle (chris <email protected>)
Date: 06/30/02

I want to be able to update a file on my server (which can be accessed
through FTP). My question is how do I go about accessing it? Do I have to
use the ftp_connect(); functions or can I just go about with something like
this:
---------------------------------------------------
// This doesn't work:

  $Location = "ftp://". $Find->USER .":". $Find->PASS ." <email protected>/files/".
$Find->BRANCH .".txt";

  if (!$fp = fopen($Location, "a"))
  {
   Error("Error: 0001. File ($Location) could not be found.");
  }
  else
  {
   if (!fwrite($fp, $Find->Line)) // line is an HTML tag/link
   {
    Error("Error: 0002. Information was not written.");
   }

   if (!fclose($fp))
   {
    Error("Error: 0003. File close error.");
   }
  }
---------------------------------------------

I cannot figure out how to access the file and update it (which is just
/file/*.txt from where I'll be accesing it). By update I mean append. I
tried to access it with the complete.

So, what file path do I use to update (append) a file on the same Windows
(2k) server as my web server (/files/*.txt is the location of the file
relative to the PHP code).

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php