Storing data on a remote server : fputs « File Directory « PHP






Storing data on a remote server

 
<?php
$file = fopen("ftp://ftp.php.net/incoming/outputfile", "w");
    if (!$file) {
    echo "<p>Unable to open remote file for writing.\n";
    exit;
}

fputs($file, "$HTTP_USER_AGENT\n");
fclose($file);
?>
  
  








Related examples in the same category

1.A Simple Text-File Hit Counter
2.Using the fputs() Function
3.Writing and Appending to a File