I want to replace the textarea named cmessage of the below code for fckeditor, and use it to send and receive data from and to a mysql database, what do I have to do in order to get it working?
Thank you very much
Database: prueba, user: root, password: <none>, table: contact.
Note, the code is generated by Dreamweaver 8.
----------- form page start-----------
<label>cid
<input name="id" type="text" id="id" />
<br />
nombre
<input name="cname" type="text" id="cname" />
</label>
<label><br />
asunto
<input name="csubject" type="text" id="csubject" />
</label>
<label><br />
email
<input name="cemail" type="text" id="cemail" />
</label>
<label></label>
<br />
<label>mensaje
<textarea name="cmessage" id="cmessage"></textarea>
</label>
<label></label>
<p>
<label></label>
</p>
<label>
<input type="submit" name="Submit" value="Enviar" />
</label>
<input type="hidden" name="MM_update" value="form1">
</form>
----------- form page end-----------
Thank you very much
Database: prueba, user: root, password: <none>, table: contact.
Note, the code is generated by Dreamweaver 8.
----------- form page start-----------
<?php require_once('Connections/prueba.php'); ?>
<?php function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue; switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) { $updateSQL = sprintf("UPDATE contact SET cname=%s, cemail=%s, csubject=%s, cmessage=%s WHERE cid=%s", GetSQLValueString($_POST['cname'], "text"), GetSQLValueString($_POST['cemail'], "text"), GetSQLValueString($_POST['csubject'], "text"), GetSQLValueString($_POST['cmessage'], "text"), GetSQLValueString($_POST['id'], "int")); mysql_select_db($database_prueba, $prueba); $Result1 = mysql_query($updateSQL, $prueba) or die(mysql_error()); } ?>
<form action="<?php echo $editFormAction; ?>" id="form1" name="form1" method="POST">
<label>cid
<input name="id" type="text" id="id" />
<br />
nombre
<input name="cname" type="text" id="cname" />
</label>
<label><br />
asunto
<input name="csubject" type="text" id="csubject" />
</label>
<label><br />
<input name="cemail" type="text" id="cemail" />
</label>
<label></label>
<br />
<label>mensaje
<textarea name="cmessage" id="cmessage"></textarea>
</label>
<label></label>
<p>
<label></label>
</p>
<label>
<input type="submit" name="Submit" value="Enviar" />
</label>
<input type="hidden" name="MM_update" value="form1">
</form>
----------- form page end-----------
RE: Use fckeditor to send/receive from mysql