note 105482 added to function.file-put-contents
| From: | GhostHawkinsbadbrizioAThotmailDOTit at osu1 dot php dot net | Date: | Mon, 22 Aug 2011 07:27:16 +0000 |
| Subject: | note 105482 added to function.file-put-contents | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-182629@lists.php.net to get a copy of this message | ||
HI, some months ago I used the advice of deqode @ 15-Feb-2010 how to use file_put_contents on FTP
server: http://www.php.net/manual/en/function.file-put-contents.php#96217
Well, it worked for a lot but until we changed root server ... after that it sometimes save
contents, sometimes save blank file.
I hope you can help me cause i really don't know what to do.
This is my code:
$contents = $_POST['text'];
$opts = array('ftp'=>array('overwrite'=> true));
$context = stream_context_create($opts);
$ret = file_put_contents("ftp://$user:$pass@$host/$path/main/server.cfg",
stripslashes($contents), false, $context)
or die("Error");
Well ... if i try echo $ret i always have the number of byte, even when no one of $contents
character is saved in the file.
What can I do?
I really hope you can help me :P
Thanks.
Fabrizio.
PS: I noticed 1 thing ... i give to the file 777 but after file_put_contents it always changes to
644 even when no one of $contents character is saved in the file.
----
Server IP: 69.147.83.197
Probable Submitter: 2.229.127.32
----
Manual Page -- http://www.php.net/manual/en/function.file-put-contents.php
Edit -- https://master.php.net/note/edit/105482
Del: integrated -- https://master.php.net/note/delete/105482/integrated
Del: useless -- https://master.php.net/note/delete/105482/useless
Del: bad code -- https://master.php.net/note/delete/105482/bad+code
Del: spam -- https://master.php.net/note/delete/105482/spam
Del: non-english -- https://master.php.net/note/delete/105482/non-english
Del: in docs -- https://master.php.net/note/delete/105482/in+docs
Del: other reasons-- https://master.php.net/note/delete/105482
Reject -- https://master.php.net/note/reject/105482
Search -- https://master.php.net/manage/user-notes.php