You mean you want a script running on machine A to write a file on machine B.
Well, you certainly won't be able to use fopen() and give it an http URL: those things are read-only for reasons both obvious and not-so-obvious.
Try ftp. Either with fsockopen() and doing the protocol yourself, or using the ftp functions.