Просмотр поста

.
Decadence

как исправить ошибку, чтобы текст в value не менялся?

$filename = 'pl/' . $user_id . '.txt';
if ($_POST){
$somecontent = $_POST['myinput'];

// Let's make sure the file exists and is writable first.
if (is_writable($filename)) {

// In our example we're opening $filename in append mode.
// The file pointer is at the bottom of the file hence
// that's where $somecontent will go when we fwrite() it.
if (!$handle = fopen($filename, 'a')) {
echo "Cannot open file ($filename)";
exit;
}

// Write $somecontent to our opened file.
if (fwrite($handle, $somecontent) === FALSE) {
echo "Cannot write to file ($filename)";
exit;
}

echo "Success, wrote ($somecontent) to file ($filename)";

fclose($handle);

} else {
echo "The file $filename is not writable";
}
}
echo'<form id="form1" name="form1" method="post" action="">
<p>
<label for="myinput"></label>
<input type="text" name="myinput" id="myinput" value="{"playlist":[
{"comment":"deca24","file":"http://deca24.ru/files/download/files/music/club/A-Sen_-_Karie_(Remix).mp3"}]}" />
</p>
<p>
<input type="submit" name="go" id="go" value="Отправить" />
</p>
</form>';