Tinymce prob
Stukje bij stukje krijg ik het werken met databases onder de knie :D
Nu wil ik een functie hebben dat ik online pagina's kan aanpassen. Ben hiernaar opzoek gegaan en kwam uit op het Tinymce - systeem.
Helaas krijg ik het niet helemaal werkend.
ik heb twee bestanden:
pagina waar het Tinymce invulveld opstaat:
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?php <title>test</title>
<!-- 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 : "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,wordcount,advlist,autosave",
// 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,restoredraft",
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>
<!-- /TinyMCE -->
</head>
<body>
<?php
include "config.php";
?>
<form method="post" action="wijzig2.php">
<div>
<!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->
<div>
<textarea id="Nieuwe_tekst" name="Nieuwe_tekst" rows="15" cols="80" style="width: 80%">
<?php
include "config.php";
$query = "SELECT * FROM `Pagina1` WHERE Pagina_id = '".mysql_real_escape_string($_GET['id'])."' ";
$sql = mysql_query($query);
while($record = mysql_fetch_object($sql))
$content = stripslashes(".$record->Pagina_tekst.");
echo $content; ?>
</textarea>
</div>
<!-- Some integration calls -->
<a href="javascript:;" onmousedown="tinyMCE.get('elm1').show();">[Show]</a>
<a href="javascript:;" onmousedown="tinyMCE.get('elm1').hide();">[Hide]</a>
<a href="javascript:;" onmousedown="tinyMCE.get('elm1').execCommand('Bold');">[Bold]</a>
<a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').getContent());">[Get contents]</a>
<a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getContent());">[Get selected HTML]</a>
<a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getContent({format : 'text'}));">[Get selected text]</a>
<a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getNode().nodeName);">[Get selected element]</a>
<a href="javascript:;" onmousedown="tinyMCE.execCommand('mceInsertContent',false,'<b>Hello world!!</b>');">[Insert HTML]</a>
<a href="javascript:;" onmousedown="tinyMCE.execCommand('mceReplaceContent',false,'<b>{$selection}</b>');">[Replace selection]</a>
<br />
<input type="submit" name="save" value="Submit" />
<input type="reset" name="reset" value="Reset" />
</div>
</form>
<script type="text/javascript">
if (document.location.protocol == 'file:') {
alert("The examples might not work properly on the local file system due to security settings in your browser. Please use a real webserver.");
}
</script>
</body>
</html>
?>
<!-- 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 : "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,wordcount,advlist,autosave",
// 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,restoredraft",
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>
<!-- /TinyMCE -->
</head>
<body>
<?php
include "config.php";
?>
<form method="post" action="wijzig2.php">
<div>
<!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->
<div>
<textarea id="Nieuwe_tekst" name="Nieuwe_tekst" rows="15" cols="80" style="width: 80%">
<?php
include "config.php";
$query = "SELECT * FROM `Pagina1` WHERE Pagina_id = '".mysql_real_escape_string($_GET['id'])."' ";
$sql = mysql_query($query);
while($record = mysql_fetch_object($sql))
$content = stripslashes(".$record->Pagina_tekst.");
echo $content; ?>
</textarea>
</div>
<!-- Some integration calls -->
<a href="javascript:;" onmousedown="tinyMCE.get('elm1').show();">[Show]</a>
<a href="javascript:;" onmousedown="tinyMCE.get('elm1').hide();">[Hide]</a>
<a href="javascript:;" onmousedown="tinyMCE.get('elm1').execCommand('Bold');">[Bold]</a>
<a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').getContent());">[Get contents]</a>
<a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getContent());">[Get selected HTML]</a>
<a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getContent({format : 'text'}));">[Get selected text]</a>
<a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getNode().nodeName);">[Get selected element]</a>
<a href="javascript:;" onmousedown="tinyMCE.execCommand('mceInsertContent',false,'<b>Hello world!!</b>');">[Insert HTML]</a>
<a href="javascript:;" onmousedown="tinyMCE.execCommand('mceReplaceContent',false,'<b>{$selection}</b>');">[Replace selection]</a>
<br />
<input type="submit" name="save" value="Submit" />
<input type="reset" name="reset" value="Reset" />
</div>
</form>
<script type="text/javascript">
if (document.location.protocol == 'file:') {
alert("The examples might not work properly on the local file system due to security settings in your browser. Please use a real webserver.");
}
</script>
</body>
</html>
?>
en het bestand dat het allemaal in werking moet zetten-> wijzig2.php :
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php
include "config.php";
if($_POST['submit'])
{
if(isset($_POST['nieuwe_tekst']))
{
$query = "UPDATE `Pagina1` SET `Pagina_tekst` = '".$_POST['Nieuwe_tekst']."' WHERE `Pagina_tekst` = '".$_POST['Nieuwe_tekst']."'";
$sql = mysql_query($query) or die(mysql_error());
print("Nieuwe pagina is ".$_POST['Nieuwe_tekst']."");
}
else
{
print("Geen gegevens ingevoerd! Geen Wijzigingen!");
}
}
else
{
include "tinytest.php";
}
?>
include "config.php";
if($_POST['submit'])
{
if(isset($_POST['nieuwe_tekst']))
{
$query = "UPDATE `Pagina1` SET `Pagina_tekst` = '".$_POST['Nieuwe_tekst']."' WHERE `Pagina_tekst` = '".$_POST['Nieuwe_tekst']."'";
$sql = mysql_query($query) or die(mysql_error());
print("Nieuwe pagina is ".$_POST['Nieuwe_tekst']."");
}
else
{
print("Geen gegevens ingevoerd! Geen Wijzigingen!");
}
}
else
{
include "tinytest.php";
}
?>
iemand die ziet waar het probleem zit? hij update namelijk de tekst niet.
En misschien maar goed dat het nog niet werkt want het script is lek.
SQL-Injection: Zie mysql_real_escape_string().
Gewijzigd op 21/07/2010 00:10:23 door - SanThe -
- Doe eens tests met isset of dat wel is wat je wilt.
- Backticks (`) uit de query halen, nergens voor nodig.
- Pagina1 klinkt niet als een goede kolomnaam, misschien eens een tutorial over normaliseren doornemen?
- Gebruik mysql_real_escape_string.
- Die is een erg onnette manier van foutafhandeling. Zeker in combinatie met het laten zien van welke error er plaats heeft gevonden. Het is wel handig voor het testen op de development server, maar op de live server wil je dan juist dat er zo min mogelijk php (o.i.d.) errors getoont worden, anders kunnen hackers die code misbruiken.
Wat is hier nu fout aan, hij wil de pagina updaten waar de nieuwe tekst gelijk is aan de oude tekst... Oftewel dit zal nooit werken tenzij je de nieuwe tekst gelijk hebt aan de huidige tekst...
Update via id...
Ik heb even jullie punten doorgelopen en ze zoveel mogelijk behandeld daar waar ik er verstand van heb (nog steeds zeer weinig :D).
de code is nu zo(zie onder) en helaas zit er nog een fout in want hij update niet:(
Wijzig2.php
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
include "config.php";
if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
if (isset($_POST['Nieuwe_tekst'])) {
$tekstnieuw = $_POST['Nieuwe_tekst'];
if (get_magic_quotes_gpc()) {
$email = stripslashes($tekstnieuw);
{
$query = "UPDATE Pagina1 SET Pagina_tekst = '".mysql_real_escape_string($_POST['Nieuwe_tekst'])."' WHERE Pagina_id = '".mysql_real_escape_string($_GET['id'])."'";
$sql = mysql_query($query) or die(mysql_error());
print("Nieuwe pagina is ".$_POST['Nieuwe_tekst']."");
print("Geen gegevens ingevoerd! Niets gewijzigd!");
}
}}}
else
{
include "tinytest.php";
}
?>
include "config.php";
if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
if (isset($_POST['Nieuwe_tekst'])) {
$tekstnieuw = $_POST['Nieuwe_tekst'];
if (get_magic_quotes_gpc()) {
$email = stripslashes($tekstnieuw);
{
$query = "UPDATE Pagina1 SET Pagina_tekst = '".mysql_real_escape_string($_POST['Nieuwe_tekst'])."' WHERE Pagina_id = '".mysql_real_escape_string($_GET['id'])."'";
$sql = mysql_query($query) or die(mysql_error());
print("Nieuwe pagina is ".$_POST['Nieuwe_tekst']."");
print("Geen gegevens ingevoerd! Niets gewijzigd!");
}
}}}
else
{
include "tinytest.php";
}
?>
wat zou de volgende stap voor mij moeten zijn om hem te laten werken?
Gewijzigd op 21/07/2010 20:00:54 door Co Vanenwijk
Dus of via een hidden file het meesturen en dan in je wijzig2.php de GET een POST maken. Of het via <form action="wijzig2.php?id="> meesturen.
En je wijzig2.php mag wel wat netter worden ingesprongen ;)
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php
include "config.php";
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if (isset($_POST['Nieuwe_tekst'])) {
$tekstnieuw = $_POST['Nieuwe_tekst'];
if (get_magic_quotes_gpc() == 1) {
$email = stripslashes($tekstnieuw); {
$query = "UPDATE Pagina1 SET Pagina_tekst = '".mysql_real_escape_string($tekstnieuw)."' WHERE Pagina_id = '".mysql_real_escape_string($_GET['id'])."'";
mysql_query($query) or die(mysql_error());
print("Nieuwe pagina is ".$_POST['Nieuwe_tekst']."");
}
}
} else {
print("Geen gegevens ingevoerd! Niets gewijzigd!");
}
} else {
include "tinytest.php";
}
?>
include "config.php";
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if (isset($_POST['Nieuwe_tekst'])) {
$tekstnieuw = $_POST['Nieuwe_tekst'];
if (get_magic_quotes_gpc() == 1) {
$email = stripslashes($tekstnieuw); {
$query = "UPDATE Pagina1 SET Pagina_tekst = '".mysql_real_escape_string($tekstnieuw)."' WHERE Pagina_id = '".mysql_real_escape_string($_GET['id'])."'";
mysql_query($query) or die(mysql_error());
print("Nieuwe pagina is ".$_POST['Nieuwe_tekst']."");
}
}
} else {
print("Geen gegevens ingevoerd! Niets gewijzigd!");
}
} else {
include "tinytest.php";
}
?>
Gewijzigd op 21/07/2010 20:47:57 door Remco nvt
Echter zit er waarschijnlijk nog ergens een probleem.
wordt namelijk niet weergegeven nadat ik op de submit knop heb gedrukt :(
krijg een blanco pagina.
Gewijzigd op 21/07/2010 21:04:50 door Co Vanenwijk
Gewijzigd op 21/07/2010 21:06:14 door Remco nvt
Code (php)
1
2
3
4
5
2
3
4
5
$email = stripslashes($tekstnieuw); {
$query = "UPDATE Pagina1 SET Pagina_tekst = '".mysql_real_escape_string($tekstnieuw)."' WHERE Pagina_id = '".mysql_real_escape_string($_GET['id'])."'";
mysql_query($query) or die(mysql_error());
print("Nieuwe pagina is ".$_POST['Nieuwe_tekst']."");
}
$query = "UPDATE Pagina1 SET Pagina_tekst = '".mysql_real_escape_string($tekstnieuw)."' WHERE Pagina_id = '".mysql_real_escape_string($_GET['id'])."'";
mysql_query($query) or die(mysql_error());
print("Nieuwe pagina is ".$_POST['Nieuwe_tekst']."");
}
Haal die { achter $email = stripslashes($tekstnieuw); eens we en die } onder print("Nieuwe pagina is ".$_POST['Nieuwe_tekst'].""); .
Dus zo:
Code (php)
1
2
3
4
2
3
4
$email = stripslashes($tekstnieuw);
$query = "UPDATE Pagina1 SET Pagina_tekst = '".mysql_real_escape_string($tekstnieuw)."' WHERE Pagina_id = '".mysql_real_escape_string($_GET['id'])."'";
mysql_query($query) or die(mysql_error());
print("Nieuwe pagina is ".$_POST['Nieuwe_tekst']."");
$query = "UPDATE Pagina1 SET Pagina_tekst = '".mysql_real_escape_string($tekstnieuw)."' WHERE Pagina_id = '".mysql_real_escape_string($_GET['id'])."'";
mysql_query($query) or die(mysql_error());
print("Nieuwe pagina is ".$_POST['Nieuwe_tekst']."");
Pagina werkt en update goed!
Hartelijk dank voor ieder die hiermee geholpen heeft!
Mijn eind code is dus:
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php
include "config.php";
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if (isset($_POST['Nieuwe_tekst'])) {
$tekstnieuw = $_POST['Nieuwe_tekst'];
if (get_magic_quotes_gpc() == 1)
$email = stripslashes($tekstnieuw); {
$query = "UPDATE Pagina1 SET Pagina_tekst = '".mysql_real_escape_string($tekstnieuw)."' WHERE Pagina_id = '".mysql_real_escape_string($_GET['id'])."'";
mysql_query($query) or die(mysql_error());
print("Nieuwe pagina is ".$_POST['Nieuwe_tekst']."");
}
} else {
print("Geen gegevens ingevoerd! Niets gewijzigd!");
}
} else {
include "tinytest.php";
}
?>
include "config.php";
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if (isset($_POST['Nieuwe_tekst'])) {
$tekstnieuw = $_POST['Nieuwe_tekst'];
if (get_magic_quotes_gpc() == 1)
$email = stripslashes($tekstnieuw); {
$query = "UPDATE Pagina1 SET Pagina_tekst = '".mysql_real_escape_string($tekstnieuw)."' WHERE Pagina_id = '".mysql_real_escape_string($_GET['id'])."'";
mysql_query($query) or die(mysql_error());
print("Nieuwe pagina is ".$_POST['Nieuwe_tekst']."");
}
} else {
print("Geen gegevens ingevoerd! Niets gewijzigd!");
}
} else {
include "tinytest.php";
}
?>
en de invoorpagina:
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<?php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>test</title>
<!-- 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 : "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,wordcount,advlist,autosave",
// 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,restoredraft",
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>
<!-- /TinyMCE -->
</head>
<body>
<?php
include "config.php";
?>
<form method="post" action="wijzig2.php?id=<?=$_GET['id']?>">
<div>
<!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->
<div>
<textarea id="Nieuwe_tekst" name="Nieuwe_tekst" rows="15" cols="80" style="width: 80%"><?php
include "config.php";
$query = "SELECT * FROM `Pagina1` WHERE Pagina_id = '".mysql_real_escape_string($_GET['id'])."' ";
$sql = mysql_query($query);
while($record = mysql_fetch_object($sql))
$content = stripslashes(".$record->Pagina_tekst.");
echo $content; ?>
</textarea>
</div>
<!-- Some integration calls -->
<a href="javascript:;" onmousedown="tinyMCE.get('elm1').show();">[Show]</a>
<a href="javascript:;" onmousedown="tinyMCE.get('elm1').hide();">[Hide]</a>
<a href="javascript:;" onmousedown="tinyMCE.get('elm1').execCommand('Bold');">[Bold]</a>
<a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').getContent());">[Get contents]</a>
<a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getContent());">[Get selected HTML]</a>
<a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getContent({format : 'text'}));">[Get selected text]</a>
<a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getNode().nodeName);">[Get selected element]</a>
<a href="javascript:;" onmousedown="tinyMCE.execCommand('mceInsertContent',false,'<b>Hello world!!</b>');">[Insert HTML]</a>
<a href="javascript:;" onmousedown="tinyMCE.execCommand('mceReplaceContent',false,'<b>{$selection}</b>');">[Replace selection]</a>
<br />
<input type="submit" name="save" value="Submit" />
<input type="reset" name="reset" value="Reset" />
</div>
</form>
<script type="text/javascript">
if (document.location.protocol == 'file:') {
alert("The examples might not work properly on the local file system due to security settings in your browser. Please use a real webserver.");
}
</script>
</body>
</html>
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>test</title>
<!-- 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 : "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,wordcount,advlist,autosave",
// 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,restoredraft",
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>
<!-- /TinyMCE -->
</head>
<body>
<?php
include "config.php";
?>
<form method="post" action="wijzig2.php?id=<?=$_GET['id']?>">
<div>
<!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->
<div>
<textarea id="Nieuwe_tekst" name="Nieuwe_tekst" rows="15" cols="80" style="width: 80%"><?php
include "config.php";
$query = "SELECT * FROM `Pagina1` WHERE Pagina_id = '".mysql_real_escape_string($_GET['id'])."' ";
$sql = mysql_query($query);
while($record = mysql_fetch_object($sql))
$content = stripslashes(".$record->Pagina_tekst.");
echo $content; ?>
</textarea>
</div>
<!-- Some integration calls -->
<a href="javascript:;" onmousedown="tinyMCE.get('elm1').show();">[Show]</a>
<a href="javascript:;" onmousedown="tinyMCE.get('elm1').hide();">[Hide]</a>
<a href="javascript:;" onmousedown="tinyMCE.get('elm1').execCommand('Bold');">[Bold]</a>
<a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').getContent());">[Get contents]</a>
<a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getContent());">[Get selected HTML]</a>
<a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getContent({format : 'text'}));">[Get selected text]</a>
<a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getNode().nodeName);">[Get selected element]</a>
<a href="javascript:;" onmousedown="tinyMCE.execCommand('mceInsertContent',false,'<b>Hello world!!</b>');">[Insert HTML]</a>
<a href="javascript:;" onmousedown="tinyMCE.execCommand('mceReplaceContent',false,'<b>{$selection}</b>');">[Replace selection]</a>
<br />
<input type="submit" name="save" value="Submit" />
<input type="reset" name="reset" value="Reset" />
</div>
</form>
<script type="text/javascript">
if (document.location.protocol == 'file:') {
alert("The examples might not work properly on the local file system due to security settings in your browser. Please use a real webserver.");
}
</script>
</body>
</html>
?>