• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 309
  • Last Modified:

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
1 Solution

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

Open in new window

bilalghouriAuthor Commented:
its not an ftp server , its http server
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now