...

View Full Version : WYSIWYG Question



ptmuldoon
06-30-2007, 03:30 PM
I'm preparing to likely add a a text area into a form where the user can input some custom comments. The info will than be posted to a database for later viewing on a 'splash screen' of a page.

I've come across fckeditor and tinymce, but does anyone have any recommendations on any other free WYSIWYG type editors?

_Aerospace_Eng_
06-30-2007, 07:52 PM
http://www.dynamicdrive.com/dynamicindex16/openwysiwyg/index.htm

ptmuldoon
06-30-2007, 11:37 PM
Thanks.

That looks promising, and simpler than the two I mentioned.

_Aerospace_Eng_
07-01-2007, 03:25 AM
If you are going to just be submitting info to a database then I think you should go with what I recommended. I use it on a few of my sites. Its simple and gets the job done.

ptmuldoon
07-02-2007, 07:52 PM
For some strange reason, I can't seem to get the info to post into my database. I'm been scouring the forums of the sites homepage, and unsure of what could be wrong. The editor works, and I type in the text area, but nothing is being posted. (I'm trying to register there, but not receiving their activation link).

This is basically what I have.

In my form, I have:
<form name="newgame" id="newgame" action="includes/create.php" method="post">

<td>
<?php $CONTENT = stripslashes($row['content']); ?>
<textarea name="content" id="content" style="height: 250px; width: 558px;"><?php echo $CONTENT; ?></textarea>
<script language="javascript1.2">
generate_wysiwyg('content');
</script>
</td>

</form>

and in my action (create.php file) I have the following:
$custom_rules = $_POST['content'];

$sql = "INSERT INTO games (custom_rules) "
." VALUES ('$custom_rules')";

_Aerospace_Eng_
07-02-2007, 08:24 PM
Where do you actually run your query? Having this alone does nothing.

$custom_rules = $_POST['content'];

$sql = "INSERT INTO games (custom_rules) "
." VALUES ('$custom_rules')";
Post the rest of create.php.

ptmuldoon
07-02-2007, 08:44 PM
yeah, I was trying to avoid posting the entire file, as its a little long. What I went and just did was create a copy of the file, saving it to txt format, and posted it on my site.

Basically, I'm inserting a new row into a table called 'games'. Everything else from the form is added except the wysiwyg information.

The entire file can be viewed Here (http://www.riskwars.com/test/test_create.txt). The code adding it to the table is located near the bottom, near this line:

// CREATE GAME REFERENCE IN GAMES TABLE

_Aerospace_Eng_
07-02-2007, 10:23 PM
Echo $custom_rules to see if its getting posted or not.

ptmuldoon
07-03-2007, 05:50 PM
echoing $custom_rules just gives me a blank page. But I think it may be something with the wysiwyg editor, or maybe a script issue or conflict. If I put basic text or html inside the textarea tags, the that html is posted into the database. But nothing I type in the wysiwyg editor is added in it.

<textarea name="custom_rules" id="textarea1" style="height: 250px; width: 558px; background-color:#CCCCCC;">
<table border="0" cellpadding="0" cellspacing="0" style="margin-left: 10px;">
<tr>
<td>
<?php $CONTENT = stripslashes($row['content']); ?>
<?php echo $CONTENT; ?>
</td>
</tr>
</table>
</textarea>
<script language="javascript1.2">
generate_wysiwyg('textarea1');
</script>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum