htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: htmlArea 2: htmlArea 2 & 3 archive (read only): htmlArea v2.0:
Problems integrating htmlarea into php/mysql cms


The htmlArea 2 & 3 editors have been discontinued.

We've made these forums available as a read-only reference and knowledge-base for people using or developing editors based on htmlArea 2 or 3.

Anyone who is interested in taking over version 2 or 3 is free to do so. All we ask is that you choose a new name that doesn't have "htmlarea" in it to avoid confusion with this site. We'll even give you a link in the directory to make it easier for people to find you. If you are developing or hosting an htmlArea based-editor under a new name, please submit it to our directory.

 


spon
New User

Jan 4, 2005, 3:50 PM

Post #1 of 2 (4067 views)
Shortcut
Problems integrating htmlarea into php/mysql cms Can't Post

Hi,

I am fairly new to php/mysql but have managed to build a simple cms which works quite well. I am now trying to integrate htmlarea into the cms to make it easier to use - however I am a relative noob and struggling!

Unfortunately I cannot get the editor to show in my php admin page - I have copied the code here for reference:

<html>
<head>
<title> News Admin </title>
<script language="Javascript1.2"><!-- // load htmlarea
_editor_url = "/htmlarea/"; // URL to htmlarea files
var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
if (navigator.userAgent.indexOf('Mac') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Opera') >= 0) { win_ie_ver = 0; }
if (win_ie_ver >= 5.5) {
document.write('<scr' + 'ipt src="' +_editor_url+ 'editor.js"');
document.write(' language="Javascript1.2"></scr' + 'ipt>');
} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }
// --></script>
</head>
<body>
<?php
// Connect to the database server
$dbcnx = @mysql_connect('localhost', 'blah_blah', 'blahblah');
if (!$dbcnx) {
die( '<p>Unable to connect to the ' .
'database server at this time.</p>' );
}
// Select the cms database
if (! @mysql_select_db('blah_cms')) {
die( '<p>Unable to locate the cms ' .
'database at this time.</p>' );
}
?>
<?php if (isset($_POST['submit']))
{
$text=$_POST['indextext'];
$sql = "UPDATE indextest SET
text='$text'
WHERE ID=1";
if (@mysql_query($sql)) {
echo('<p>Status has been updated.</p>');
} else {
echo('<p>Error updating status: ' .
mysql_error() . '</p>');
}
}
?>
<?php $pulltext=@mysql_query("SELECT text
FROM indextest
WHERE ID=1");
if (!$pulltext) {
die('<p>Error fetching text details: ' .
mysql_error() . '</p>');
}
$pulltext = mysql_fetch_array($pulltext);
$text = $pulltext['text'];
?>
<div align="center"><form action="<?=$_SERVER['PHP_SELF']?>" method="post">
<textarea name="indextext" cols="50" rows="20" wrap><?php echo $text;?></textarea>
<input type="submit" name="submit" value="SUBMIT">
</form><script language="JavaScript1.2" defer>
editor_generate('indextest');
</script>

</div>
</body>
</html>

If anyone can help out ref. where the javascript elements should go I would be most grateful.

Currently the editor will not show and I am also getting a browser error "document.all[..]' is null or not an object". However, the original textarea does show and updates are writing to the database.

Any help most welcomed!

Thanks

spon


spon
New User

Jan 5, 2005, 2:05 PM

Post #2 of 2 (4038 views)
Shortcut
Re: [spon] Problems integrating htmlarea into php/mysql cms [In reply to] Can't Post

Ok sorted it - I used "indextest" and not "indextext" as the text area name!!!!!!!

Blush

 
 
 


Search for (options)