HELP! I lost count of how many editors I tried! I don't understand why non of them work.
I'm trying this editor http://nicedit.com/index.php
very simple. but when I type words in the textarea and click submit nothing is saved in the DB..empty that's what I get.
all I want is a textarea with a bold, underline and italic buttons. user types, makes things bold or whatever, click save and it's saved as "<b> blah </b>" or "[b.]blah[/b.]" (don't understand the difference between html and bb) in my DB. then I display it somewhere and the user sees "blah"
can someone help me with this?
here's my code
<body>
<?php if (isset($_GET['...'])&&isset($_GET['..'])) {?>
<table>
<tr>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<td>
<?php echo' <input type="text" id="title" name="title" />';?>
<script src="new/nicEdit.js" type="text/javascript"></script>
<script type="text/javascript">
bkLib.onDomLoaded(function() {
new nicEditor({buttonList : ['fontSize','bold','italic','underline','strikeThrough','subscript','superscript','html','image']}).panelInstance('area4');
});
</script>
<textarea cols="50" id="area4" name="area4"></textarea>
<hr>
<input type="submit" name="submit" value="save" />
</td>
</form>
</tr>
</table>
}
if (isset($_POST['submit'])) {
if (isset($_POST['title']) && isset($_POST['area4')) {
$title = $_POST['title'];
$content = $_POST['area4'];
require_once('connectvars.php');
$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD, TRUE)or die('Error connecting to MySQL server.');
mysql_selectdb(DB_NAME,$link)or die ('Error selecting to MySQL server.');
mysql_set_charset('utf-8', $link) or die ('Error changing charset');
//add to the database
$query = "INSERT INTO tblcomment (commentId, title, content, dateCreated) ".
"VALUES (NULL, '$title', '$content', CURRENT_TIMESTAMP);";?>
}
</body>