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:
Write the contens of the editor in Mysql Database


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.

 


dsidir
New User

Oct 20, 2004, 4:03 AM

Post #1 of 4 (2273 views)
Shortcut
Write the contens of the editor in Mysql Database Can't Post

How I can pass the contents of the editor into another php page, so that I can write to a mysql database

Is it possible ?


e_developer
New User

Dec 8, 2004, 8:54 PM

Post #2 of 4 (2056 views)
Shortcut
Re: [dsidir] Write the contens of the editor in Mysql Database [In reply to] Can't Post

hi, I did this, but I use ACCESS (mdb) and ASP (Active Server Pages)

<form name="htmlarea" method="POST" action="post.asp">

<textarea name="pcontent" style="width:780; height:450;">
<p>text here</p>
</textarea>

<script language="javascript1.2">
editor_generate('pcontent');
</script>
<input type="submit" value=" save " name="B1" ></td>

</form>



this is POST.ASP action code

pcontent=request("pcontent")
rs2.open "TABLENAME", alan, 1, 3
rs2.addnew
rs2.close


pcontent is textarea name
OXIGEN-interactive


ottergoose
Novice

Dec 9, 2004, 1:57 PM

Post #3 of 4 (2028 views)
Shortcut
Re: [dsidir] Write the contens of the editor in Mysql Database [In reply to] Can't Post


Code
 
<?php
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password'); // connect to mysql

mysql_select_db('databasename', $link); // select database

$query = "INSERT INTO 'tablename'('name_of_field_in_table_that_will_store_contents') VALUES('" . $nameOfFieldSubmittedThatContainsContents . "')"; // define your query

mysql_query($query); // Execute query

mysql_close($link); // Close connection to mysql
?>


That is a very simple example. You'll need to learn some more about PHP and MySQL to do more. Do a google search for "PHP MySQL tutorial" and you should find anything else that you need to know.


everah
New User

Dec 10, 2004, 8:17 AM

Post #4 of 4 (2006 views)
Shortcut
Re: [ottergoose] Write the contens of the editor in Mysql Database [In reply to] Can't Post

Yes, it is possible. Just remember to add slashes to the posted textarea contents. Example:


Code
 $post_data = $HTTP_POST_VARS['textarea_field_name'];$post_data = addslashes($post_data);//For insert into DB$sql = "INSERT INTO table_name (`field_name`) VALUES ('$post_data')";$result = @mysql_query($sql);



You should do a lot of error checking on the process. If MySQL hangs up or errors the INSERT, it could be bad SQL or it could be that it does not like the backslashes (\), single quotes (') or double quotes (") that are added by htmlArea when writing the code.



Hope that helps.

 
 
 


Search for (options)