bom galera.. to com um probleminha q é o seguinte.. eu ate consegui fazer os includes e tals.. aparece o editor html acima do textarea e tudo mais.. mais to com um problema q é o seguinte.. tipo.. eu quero pegar o conteudo do textarea.. formatado em HTML e jogar pra dentro de um bando de dados mysql mesmo
o problema é q tipo.. ele vai la na pagina de texte do TinyMCE e me mostra o conteudo.. porém acho q precisa de alguma função para abstrair o conteudo desse textarea e jogar pra dentro de uma variavel qualquer.. alquem gem uma luz?? segue abaixo o arquivo q estou fazendo o teste...
abraços
<html> <head> <title> TinyMCE Teste </title>
<script language="javascript" type="text/javascript" src="/jscripts/tiny_mce/tiny_mce.js"> </ script>
<script Language="javascript" type="text/javascript">
tinyMCE.init ((modo: "textareas"));
</script> </head>
<!-- TinyMCE -->
<script type="text/javascript" src="/jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
// General options
mode : "textareas",
theme : "advanced",
plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
// Theme options
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
// Example content CSS (should be your site CSS)
content_css : "css/content.css",
// Drop lists for link/image/media/template dialogs
template_external_list_url : "lists/template_list.js",
external_link_list_url : "lists/link_list.js",
external_image_list_url : "lists/image_list.js",
media_external_list_url : "lists/media_list.js",
// Replace values for the template plugin
template_replace_values : {
username : "Some User",
staffid : "991234"
}
});
</script>
<!-- /TinyMCE -->
<?php
$conn = mysql_connect("localhost","root","");
$db = mysql_select_db("test",$conn);
//$banco = new PDO('mysql:host=localhost;dbname=test', 'root','');
//http://tinymce.moxiecode.com/dump.php?example=true
?>
<body>
<form Method="post" action="http://tinymce.moxiecode.com/dump.php?example=true">
<textarea name="content" cols="50" rows="15"> Esta é Alguns conteúdos que serão editáveis com TinyMCE. </textarea>
<input type="submit" value="Save" name="send"/>
<?php
//$valor=$_POST['content'];
//$sql=mysql_query("INSERT INTO `teste` VALUES ('$valor')");
$sql1=mysql_query("INSERT INTO `teste` VALUES ('$content')");
?>
</form>
</body>
</html>
Pergunta
fabiosanches
bom galera.. to com um probleminha q é o seguinte.. eu ate consegui fazer os includes e tals.. aparece o editor html acima do textarea e tudo mais.. mais to com um problema q é o seguinte.. tipo.. eu quero pegar o conteudo do textarea.. formatado em HTML e jogar pra dentro de um bando de dados mysql mesmo
o problema é q tipo.. ele vai la na pagina de texte do TinyMCE e me mostra o conteudo.. porém acho q precisa de alguma função para abstrair o conteudo desse textarea e jogar pra dentro de uma variavel qualquer.. alquem gem uma luz?? segue abaixo o arquivo q estou fazendo o teste...
abraços
<html> <head> <title> TinyMCE Teste </title> <script language="javascript" type="text/javascript" src="/jscripts/tiny_mce/tiny_mce.js"> </ script> <script Language="javascript" type="text/javascript"> tinyMCE.init ((modo: "textareas")); </script> </head> <!-- TinyMCE --> <script type="text/javascript" src="/jscripts/tiny_mce/tiny_mce.js"></script> <script type="text/javascript"> tinyMCE.init({ // General options mode : "textareas", theme : "advanced", plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template", // Theme options theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect", theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor", theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen", theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true, // Example content CSS (should be your site CSS) content_css : "css/content.css", // Drop lists for link/image/media/template dialogs template_external_list_url : "lists/template_list.js", external_link_list_url : "lists/link_list.js", external_image_list_url : "lists/image_list.js", media_external_list_url : "lists/media_list.js", // Replace values for the template plugin template_replace_values : { username : "Some User", staffid : "991234" } }); </script> <!-- /TinyMCE --> <?php $conn = mysql_connect("localhost","root",""); $db = mysql_select_db("test",$conn); //$banco = new PDO('mysql:host=localhost;dbname=test', 'root',''); //http://tinymce.moxiecode.com/dump.php?example=true ?> <body> <form Method="post" action="http://tinymce.moxiecode.com/dump.php?example=true"> <textarea name="content" cols="50" rows="15"> Esta é Alguns conteúdos que serão editáveis com TinyMCE. </textarea> <input type="submit" value="Save" name="send"/> <?php //$valor=$_POST['content']; //$sql=mysql_query("INSERT INTO `teste` VALUES ('$valor')"); $sql1=mysql_query("INSERT INTO `teste` VALUES ('$content')"); ?> </form> </body> </html>Link para o comentário
Compartilhar em outros sites
11 respostass a esta questão
Posts Recomendados
Participe da discussão
Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.