ik gebruik TinyMCE voor het eerst, nu wil ik ipv alleen het voorbeeld, ook het script in een variabele hebben..
ik heb nu deze code:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="css.css" type="text/css">
<?
if (!empty($_POST)){
$elm1 = $_POST['elm1'];
$elm1 = stripslashes ( $elm1 );
echo "$elm1";
echo "<br><br>";
}
?>
<!-- TinyMCE -->
<script language="javascript" type="text/javascript" src="../jscripts/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "advanced",
plugins : "style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,flash,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable",
theme_advanced_buttons1: "save,newdocument,separator,bold,italic,underline,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,styleselect, formatselect",
theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview",
theme_advanced_buttons2_add_before: "cut,copy,paste,pastetext,pasteword,separator,search,replace,separator",
theme_advanced_buttons3_add_before : "tablecontrols,separator",
theme_advanced_buttons3_add : "emotions,iespell,flash,advhr,separator,print,separator,ltr,rtl,separator,fullscreen",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_path_location : "bottom",
content_css : "nieuw.css",
plugin_insertdate_dateFormat : "%Y-%m-%d",
plugin_insertdate_timeFormat : "%H:%M:%S",
extended_valid_elements : "hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
external_link_list_url : "example_link_list.js",
external_image_list_url : "example_image_list.js",
flash_external_list_url : "example_flash_list.js",
file_browser_callback : "fileBrowserCallBack",
theme_advanced_resize_horizontal : true,
theme_advanced_resizing : true
});
function fileBrowserCallBack(field_name, url, type, win) {
// This is where you insert your custom filebrowser logic
alert("Example of filebrowser callback: field_name: " + field_name + ", url: " + url + ", type: " + type);
// Insert new URL, this would normaly be done in a popup
win.document.forms[0].elements[field_name].value = "EenUrl.htm";
}
</script>
<!-- /TinyMCE -->
</head>
<body>
<form method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
<textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 100%">
<span class="example1">Test header 1</span><br />
<span class="example2">Test header 2</span><br />
<span class="example3">Test header 3</span><br />
Some <b>element</b>, this is to be editor 1. <br /> This editor instance has a 100% width to it.
<p>Some paragraph. <a href="http://www.sourceforge.net">Some link</a></p>
<img src="logo.jpg">
</textarea>
<br />
<input type="submit" name="save" value="Submit" />
<input type="reset" name="reset" value="Reset" />
</form>
</body>
</html>
Bij dat echo "$elm1"; moet hij dus nu de script van alles laten showen; niet het voorbeeld (CSS en text enz)