Hello you PHP-gurus,
I've put the following code on a page:
The code works fine. Whatever I write in the contenteditable div is saved and stored on the server.
$fn = "file.html";
$file = fopen($fn, "r+");
$size = filesize($fn);
if($_POST['addition']) fwrite($file, $_POST['addition']);
$html = fread($file, $size);
<form name="myform" action="<?=$PHP_SELF?>" method="post" target="frame">
<div id="the_content" contenteditable="true" >
<input type="text" name="addition" id="addition" style="display:none">
<button onmouseover="document.getElementById('addition').focus();document.getElementById('addition').value=document.getElementById('the_content').innerHTML" onmouseup="document.myform.submit();">Save</button>
<iframe name="frame" style="display: none"></iframe>
My problem is the behavior of one of my servers. Whenever I put something between quotes in the contenteditable div, it (the server) ads a backslash. I've googled around and tried all kinds of suggestions but without succes. Does anyone have a solution for this particular case?