It's a really simple thing, in a few steps:
It makes a textarea that is writable to a .txt file. I display this text area with:
<div id="change"><span id="a1" class="editText"><? echo $textInfile; ?></span></div>
.
This goes trough:
<?
$thefile = "files/edit.txt";
$textInfile = file_get_contents($thefile);
?>
This saves the file to edit.txt
The main config has these:
$fieldname = htmlspecialchars($_GET['fieldname']);
$content = stripslashes(strip_tags($_GET['content'],"<p><img><i></i></p><h1></h1><h2></h2></a><li></li><a><strong><em><strike><b>"));
$content = trim($content);
$content=nl2br($content);
User enters content into the text area and it writes it directly to the txt file once the user clicks out of the area.
So far the most efficient thing that worked (or not) is :
str_replace("<br>", "\n", $content);
This would be perfect if it didn't disable <br>'s completely.
Also another thing, when you click on the text area on http://krneky.com/ccms (password demo) the text area shows normal <br> tags, while the ones saved in http://krneky.com/ccms/files/edit3.txt (the text files), shows <br />.
I have no idea what else is there to try.
Edit: I'm also using
- http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js
- http://krneky.com/ccms/js/editInplace.js
- http://krneky.com/ccms/js/wkrte.js
- http://krneky.com/ccms/js/jquery-1.3.2.min.js
Do you think any one of these may be causing problems?