Click to See Complete Forum and Search --> : Trouble loading updated info from database into wysiwyg


jmrouleau
02-19-2006, 09:58 PM
I design farely small scale websites for local companies. I am working on a content management system coded in php but I cant get past this one problem.

I have a wysiwyg editor that loads a page which you choose to edit. After submitting the changes the content is put in the database. But, if you try to edit the page again the changes won't show up. It seems that the wysiwyg is loading from cache rather than drawing from the database.

Any help with this problem would be great!!

Thanks

www.BlackPearlWeb.com (http://www.blackpearlweb.com)

bpat1434
02-20-2006, 11:30 AM
umm... what wysiwyg editor are you using?

jmrouleau
02-20-2006, 11:57 AM
Text Area Rich (http://www.textarearich.com) for now. I'm hoping to develop my own eventually though.

I am also having an issue when I try to create a new page....The editor locks up with a javascript error saying the viewMode is undefined. This problem came about after changing the blank.html file that loads into the editor. I tried to change it back but it still doesn't seem to work.

blank.htm:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>

</body>
</html>
I'm pretty sure it has something to do with this file because if I try to edit a page it works fine.
editable.php:
<?php
require'connect.php';

if(isset($_GET['id'])){
$getContents= 'Select content, title FROM pages WHERE keyword="'.$_GET['id'].'" LIMIT 1';
$content=$conn->Execute($getContents);

if($content->EOF){
die('The Page You Have Requested Is Currently Unavailable.');
}else{

echo '<html>'.$content->fields[0]->value.'</html>';
}
}
?>

BTW...the editor is configured to only save from <body> to </body>...I then trim these tags off before I send to database.

bpat1434
02-20-2006, 04:39 PM
have you physically looked in the database to see the changes?

You might try a cache handeling header in your php file....

jmrouleau
02-21-2006, 06:12 PM
Yea...the changes do take effect in the database and they even show up on the website.

Cache handling header?? I'm not familiar with these.

bpat1434
02-21-2006, 06:13 PM
header (http://us2.php.net/header)
Look in the user notes for Cache-Control and the like...