George Botley Posted July 7, 2009 Share Posted July 7, 2009 Hi, I have created a CMS system but it doesn't like the WYSIWUG... How can i get the PHP to actually process the HTML content that is posted from the WYSIWUG into a database table, and to second that, how can I get it to update the WYSIWUG data that exists on a pages record. Please help, as the client is getting annoyed... Require any of my written scripts? - Just ask.. Quote Link to comment Share on other sites More sharing options...
arneman Posted July 7, 2009 Share Posted July 7, 2009 I would suggest you take a look at FCKEditor, http://www.fckeditor.net Quote Link to comment Share on other sites More sharing options...
George Botley Posted July 7, 2009 Author Share Posted July 7, 2009 Thats what IM using actually It doesn't like updating data where HTML content already exisits in a database, although it will add new data with an INSERT command without any issues whatsoever. any ideas? Quote Link to comment Share on other sites More sharing options...
arneman Posted July 7, 2009 Share Posted July 7, 2009 Well I'm no expert on this, and I'm having some problems with the FCKeditor myself. But you should take a look at their forums, they helped me a lot. Quote Link to comment Share on other sites More sharing options...
zq29 Posted July 7, 2009 Share Posted July 7, 2009 Code? (Don't forget the [code][/code] tags!) Quote Link to comment Share on other sites More sharing options...
George Botley Posted July 8, 2009 Author Share Posted July 8, 2009 <? /* 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' />"; } elseif("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']; } } ?> My apologies.... By looking above I can't see any errors... can you? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.