Hello,
I could really use your help!!
I have created a CMS system which works as intended apart from one aspect, the FCK editor...
I code in PHP and the only thing I am struggling with, is actually getting the PHP to INSERT and UPDATE table data whilst using FCK editor. When using a standard text box I encounter no problems what so ever. However when using FCK editor, my scripts don't function.
Why is this? Am I doing something wrong.... Below is the scripts.
Edit Page PHP (UPDATE RECORDS)
<? /* Include Configuration Files */ include_once "../config/config.php"; //Edit Page $edit = $_GET["edit"]; if("yes" == $edit) { /* Update Page within database. */ $year = date('Y'); $month = date('m'); $day = date('d'); $con = mysql_connect("$server","$dbuser","$dbpass"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("$database", $con); $id = $_POST["id"]; $title1 = $_POST["title"]; $content1 = $_POST["website_content"]; $visible = $_POST["visible"]; mysql_query("UPDATE ap_pages SET title = '$title1' WHERE id LIKE '$id'"); mysql_query("UPDATE ap_pages SET content = '$content1' WHERE id LIKE '$id'"); mysql_query("UPDATE ap_pages SET dateedit = '$year-$month-$day' WHERE id LIKE '$id'"); mysql_query("UPDATE ap_pages SET visible = '$visible' WHERE id LIKE '$id'"); mysql_close($con); echo '<div class="alertsuccess_info"> <strong>Page Modified Successfully</strong> - Your changes have taken effect immeadiately. </div>'; echo "<meta http-equiv='refresh' content='3;url=index.php?ToDo=WebsiteContent/ViewPages' />"; } if("yes" != $edit) { $con = mysql_connect("$server","$dbuser","$dbpass"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("$database", $con); $pageid = $_GET["id"]; $result = mysql_query("SELECT * FROM ap_pages WHERE id = '$pageid'"); while($row = mysql_fetch_array($result)) { $id = $row['id']; $title1 = $row['title']; $content = $row['content']; $date = $row['date']; $date1 = $row['dateedit']; $visible = $row['visible']; } } ?>
Re: I really need your help!!! :( - MY FCKeditor wont work
Re: I really need your help!!! :( - MY FCKeditor wont work
Can you explain this a bit more clearly? When does it fail - on editor page load, during editing, on submit? What is the nature of the failure? Do you get error codes?
I have a small CMS that I've just updated to use FCK and it was generally a breeze. my first reaction to what you've described is to note that FCK is only going to effect what is going on on the client (browser) end of things. Once the user submits the form, PHP deals with the output in the same way that it does the output of a textfield. If your code works with a textfield, it should work just the same with the output of an editor.
Here are a couple of things that you need to pay attention to:
1) does your code work WITHOUT fck?
2) how are you handling the data on the server side? (encoding, etc.)
Read the docs! it helps ... I've learned that the hard way!