hi,
What is the best way to create a file on a remote server in php. Would fsocketsopen() be a way?
And if possible the files should be created with a username and password.. the same one i use login in with like a ftp client.
But this needs to be done with php. Any help would be much appreciated.
creating a file on a remote server
Moderator: General Moderators
-
chocolatetoothpaste
- Forum Newbie
- Posts: 10
- Joined: Wed Sep 06, 2006 10:48 am
Just use
It will try to write to a file, or create it if it doens't exist.
I don't know if you can give the file a username/password, but you could create a sub-folder for each user that is named after their user ID or some other identifier.
Code: Select all
$handle = fopen($filename, 'a');
fwrite($handle, $content);I don't know if you can give the file a username/password, but you could create a sub-folder for each user that is named after their user ID or some other identifier.
yes i have full access.
what i need to do is get content from a database, create an html page, and send it to another website/server whatever. the files need to be created there.
i'm just not sure what the best way is. if i use the ftp function that php provides, i'd first have to create a local file no?
what i need to do is get content from a database, create an html page, and send it to another website/server whatever. the files need to be created there.
i'm just not sure what the best way is. if i use the ftp function that php provides, i'd first have to create a local file no?