Link to home
Start Free TrialLog in
Avatar of bilalghouri
bilalghouri

asked on

how to write to a file on a remote server using php?

how to write to a file on a remote server using php?
the server's folder has chmod 777

i am trying to make  a script which can write to files on remote server
Avatar of webvogel
webvogel


<?php
$file = fopen ("ftp://ftp.server.com/incoming/outputfile", "w");
if (!$file) {
    echo "Error";
    exit;
}
fputs ($file, $_SERVER['HTTP_USER_AGENT'] . "\n");
fclose ($file);
?>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of bilalghouri
bilalghouri

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial