PDA

View Full Version : مشکل در گرفتن مقدار tiny_mce



$ M 3 H R D A D $
پنج شنبه 08 مهر 1389, 16:25 عصر
سلام این مد html :



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Untitled 1</title>
<script src="tiny_mce.js" type="text/javascript"></script>
<script type="text/javascript">
tinyMCE.init({
// General options
mode : "textareas",
theme : "advanced",
plugins : "pagebreak,style,layer,table,save,advhr,advimage,ad vlink,emotions,iespell,inlinepopups,insertdatetime ,preview,media,searchreplace,print,contextmenu,pas te,directionality,fullscreen,noneditable,visualcha rs,nonbreaking,xhtmlxtras,template,wordcount,advli st,autosave",

// Theme options
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethr ough,|,justifyleft,justifycenter,justifyright,just ifyfull,styleselect,formatselect,fontselect,fontsi zeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replac e,|,bullist,numlist,|,outdent,indent,blockquote,|, undo,redo,|,link,unlink,anchor,image,cleanup,help, code,|,insertdate,inserttime,preview,|,forecolor,b ackcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,su p,|,charmap,emotions,iespell,media,advhr,|,print,| ,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,st yleprops,|,cite,abbr,acronym,del,ins,attribs,|,vis ualchars,nonbreaking,template,pagebreak,restoredra ft",
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",

// Style formats
style_formats : [
{title : 'Bold text', inline : 'b'},
{title : 'Red text', inline : 'span', styles : {color : '#ff0000'}},
{title : 'Red header', block : 'h1', styles : {color : '#ff0000'}},
{title : 'Example 1', inline : 'span', classes : 'example1'},
{title : 'Example 2', inline : 'span', classes : 'example2'},
{title : 'Table styles'},
{title : 'Table row 1', selector : 'tr', classes : 'tablerow1'}
],

// Replace values for the template plugin
template_replace_values : {
username : "Some User",
staffid : "991234"
}
});
</script>
<script type="text/javascript">

function send(frm)
{
var ans = confirm("آیا برای ثبت این خبر اطمینان دارید ؟");
if(ans)
{
return true;
}
else
{
return false;
}
}
</script>
<style type="text/css" >
[type='submit']{
font-family:Tahoma;
font-size:9pt;
}
[type='reset']{
font-family:Tahoma;
font-size:9pt;
}

p{
font-family:Tahoma;
font-size:8pt;
direction:rtl;
text-align:right;
margin-right:100px;
padding:20px 0 0 10px;

}
ul{
padding: 20px 0px 26px 0;
list-style:none;
margin:0;

}
li
{
float: left;
margin-right: 10px;
border: 1px solid #ecffec;
}
textarea{
border:thin silver solid;
}
[type='text']{
font-family:Tahoma;
font-size:8pt;
direction:rtl;
text-align:right;
}
select{
font-family:Tahoma;
font-size:8pt;
direction:rtl;
text-align:center;

}
body{

background-color:#EFEFEF;
}
#kadr{
border:thin gray solid;
}
</style>
</head>

<body>
<div id="kadr">
<form name="letter" id="letter" action="letter.php" method="post" onsubmit="return send(this);" >
<p>عنوان خبر :&nbsp;&nbsp;&nbsp;&nbsp;
<input type="text" name="title" size="50px" style="width: 733px" /></p>
<p>منبع خبری :&nbsp;&nbsp;&nbsp;&nbsp; <input type="text" name="source" size="50px" style="width: 729px" /></p>
<p>گروه خبر ی:&nbsp;&nbsp;&nbsp;&nbsp; <select name="cat" dir="rtl">

<option value="acm">اخبار انجمن</option>
<option value="uni">اخبار دانشگاه</option>
</select></p>
<div align="center">
<textarea id="elm1" rows="15" cols="80" style="width: 80%;direction:rtl;text-align:right;" name="elm1"></textarea>
</div>
<div align="center">
<ul style="float:right;margin-left:5px;font-family:Tahoma;font-size:8pt;list-style:none;">
<li><a href="javascript:;" onmousedown="tinyMCE.get('elm1').show();">[نمایش ادیتور]</a></li>
<li><a href="javascript:;" onmousedown="tinyMCE.get('elm1').hide();">[مخفی کردن ادیتور]</a></li>
<li><a href="javascript:;" onmousedown="tinyMCE.get('elm1').execCommand('Bold');">[حجیم کردن متن]</a></li>
<li><a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').getContent());">[گرفتن محتویات]</a></li>
<li><a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getContent());">[گرفتن کد اچ تی ام ال متن انتخاب شده]</a></li>
<li><a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getContent({fo rmat : 'text'}));">[گرفتن متن انتخاب شده]</a></li>
<li><a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getNode().node Name);">[Get selected element]</a></li>
<li><a href="javascript:;" onmousedown="tinyMCE.execCommand('mceInsertContent',false,'<b>Hello world!!</b>');">[Insert HTML]</a></li>
<li><a href="javascript:;" onmousedown="tinyMCE.execCommand('mceReplaceContent',false,'<b>{$selection}</b>');">[Replace selection]</a></li>
</ul>
</div>
<div align="center">
<input id="Button1" type="submit" value="ارسال خبر" />
<input type="reset" value="خالی کردن متن" />
</div>
</form>
</div>
</body>

</html>



سمت سرور


$s =$_POST['elm1'];



اما چیزی چاپ نمیشه وقتی اکو میشه

funpatogh
پنج شنبه 08 مهر 1389, 17:58 عصر
تست کردم و مشکلی نداشت


<?php
$s =$_POST['elm1'];
echo $s;
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Untitled 1</title>
<script src="http://funpatogh.com/Administrator/editor/tiny_mce/tiny_mce.js" type="text/javascript"></script>
<script type="text/javascript">
tinyMCE.init({
// General options
mode : "textareas",
theme : "advanced",
plugins : "pagebreak,style,layer,table,save,advhr,advimage,ad vlink,emotions,iespell,inlinepopups,insertdatetime ,preview,media,searchreplace,print,contextmenu,pas te,directionality,fullscreen,noneditable,visualcha rs,nonbreaking,xhtmlxtras,template,wordcount,advli st,autosave",

// Theme options
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethr ough,|,justifyleft,justifycenter,justifyright,just ifyfull,styleselect,formatselect,fontselect,fontsi zeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replac e,|,bullist,numlist,|,outdent,indent,blockquote,|, undo,redo,|,link,unlink,anchor,image,cleanup,help, code,|,insertdate,inserttime,preview,|,forecolor,b ackcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,su p,|,charmap,emotions,iespell,media,advhr,|,print,| ,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,st yleprops,|,cite,abbr,acronym,del,ins,attribs,|,vis ualchars,nonbreaking,template,pagebreak,restoredra ft",
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",

// Style formats
style_formats : [
{title : 'Bold text', inline : 'b'},
{title : 'Red text', inline : 'span', styles : {color : '#ff0000'}},
{title : 'Red header', block : 'h1', styles : {color : '#ff0000'}},
{title : 'Example 1', inline : 'span', classes : 'example1'},
{title : 'Example 2', inline : 'span', classes : 'example2'},
{title : 'Table styles'},
{title : 'Table row 1', selector : 'tr', classes : 'tablerow1'}
],

// Replace values for the template plugin
template_replace_values : {
username : "Some User",
staffid : "991234"
}
});
</script>
<script type="text/javascript">

function send(frm)
{
var ans = confirm("آیا برای ثبت این خبر اطمینان دارید ؟");
if(ans)
{
return true;
}
else
{
return false;
}
}
</script>
<style type="text/css" >
[type='submit']{
font-family:Tahoma;
font-size:9pt;
}
[type='reset']{
font-family:Tahoma;
font-size:9pt;
}

p{
font-family:Tahoma;
font-size:8pt;
direction:rtl;
text-align:right;
margin-right:100px;
padding:20px 0 0 10px;

}
ul{
padding: 20px 0px 26px 0;
list-style:none;
margin:0;

}
li
{
float: left;
margin-right: 10px;
border: 1px solid #ecffec;
}
textarea{
border:thin silver solid;
}
[type='text']{
font-family:Tahoma;
font-size:8pt;
direction:rtl;
text-align:right;
}
select{
font-family:Tahoma;
font-size:8pt;
direction:rtl;
text-align:center;

}
body{

background-color:#EFEFEF;
}
#kadr{
border:thin gray solid;
}
</style>
</head>

<body>
<div id="kadr">
<form name="letter" id="letter" method="post" onsubmit="return send(this);" >
<p>عنوان خبر :&nbsp;&nbsp;&nbsp;&nbsp;
<input type="text" name="title" size="50px" style="width: 733px" /></p>
<p>منبع خبری :&nbsp;&nbsp;&nbsp;&nbsp; <input type="text" name="source" size="50px" style="width: 729px" /></p>
<p>گروه خبر ی:&nbsp;&nbsp;&nbsp;&nbsp; <select name="cat" dir="rtl">

<option value="acm">اخبار انجمن</option>
<option value="uni">اخبار دانشگاه</option>
</select></p>
<div align="center">
<textarea id="elm1" rows="15" cols="80" style="width: 80%;direction:rtl;text-align:right;" name="elm1"></textarea>
</div>
<div align="center">
<ul style="float:right;margin-left:5px;font-family:Tahoma;font-size:8pt;list-style:none;">
<li><a href="javascript:;" onmousedown="tinyMCE.get('elm1').show();">[نمایش ادیتور]</a></li>
<li><a href="javascript:;" onmousedown="tinyMCE.get('elm1').hide();">[مخفی کردن ادیتور]</a></li>
<li><a href="javascript:;" onmousedown="tinyMCE.get('elm1').execCommand('Bold');">[حجیم کردن متن]</a></li>
<li><a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').getContent());">[گرفتن محتویات]</a></li>
<li><a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getContent());">[گرفتن کد اچ تی ام ال متن انتخاب شده]</a></li>
<li><a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getContent({fo rmat : 'text'}));">[گرفتن متن انتخاب شده]</a></li>
<li><a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getNode().node Name);">[Get selected element]</a></li>
<li><a href="javascript:;" onmousedown="tinyMCE.execCommand('mceInsertContent',false,'<b>Hello world!!</b>');">[Insert HTML]</a></li>
<li><a href="javascript:;" onmousedown="tinyMCE.execCommand('mceReplaceContent',false,'<b>{$selection}</b>');">[Replace selection]</a></li>
</ul>
</div>
<div align="center">
<input id="Button1" type="submit" value="ارسال خبر" />
<input type="reset" value="خالی کردن متن" />
</div>
</form>
</div>
</body>

</html>