Jump to content

PHP and WYSIWUG


George Botley

Recommended Posts

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..

Link to comment
https://forums.phpfreaks.com/topic/165092-php-and-wysiwug/
Share on other sites


<? 

/* 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?

Link to comment
https://forums.phpfreaks.com/topic/165092-php-and-wysiwug/#findComment-871170
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.