i call a php script which is sat on a php server from mydomain (its the way the isp is set up). i can call the script, send it a file name and data and it will create/write the file without any problems. that means it writes the file in a directory on the php server. i can specify a directory using a pathname and its all fine.
i really want to write back to the mydomain and not the php server.
the code i have does not work
<?php
$file = fopen ("ftp://ftp.mydomain.com/testfile.xml", "w");
if (!$file) {
echo "<p>Unable to open remote file for writing.\n";
exit;
}
/* Write the data here. */
fwrite ($file, $_SERVER['HTTP_USER_AGENT'] . "\n");
fclose ($file);
?>
i have also tried
$file = fopen ("ftp://ftp.username: password.mydomain.com/testfile.xml", "w");
without success.
tbh i am fishing around trying stuff without knowing what i am doing and this is a big issue for me that i need to fix quickly.
any help would be greatly appreciated