Textarea vervangen door fckeditor
TEXT based CMS gebruikt maar was niet tevreden over htmlarea daarom besloot ik om FCKeditor hierin te zetten maar dit werkt nog niet :( het is vast simpel maar wie kan mij ermee helpen?
ik kan het bestand niet editen als ik op update pagina druk...
ik denk zelf dat de fout bij regel 32 zit maar krijg hem er niet uit
Beste iedereen ik heb een poosje het script ik kan het bestand niet editen als ik op update pagina druk...
ik denk zelf dat de fout bij regel 32 zit maar krijg hem er niet uit
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
105
106
107
108
109
110
111
112
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
105
106
107
108
109
110
111
112
<?php
include_once("fckeditor/fckeditor.php") ;
?>
<?php
if(!empty($_SESSION['login'])){
if(!empty($_POST)){
$_GET['file'] = $_POST['file'];
}
if(!file_exists(lock.$_GET['file'])){
if(!empty($_POST)){
if($handle = fopen(dir.$_POST['file'],'w+')){
if(fwrite($handle,stripslashes($_POST['content']))){
$text = $lang['file']['succes'];
}else{
$text = $lang['file']['error'];
}
}else{
$text = $lang['file']['read_error'];
}
}else{
if(!empty($_GET['file'])){
if(file_exists(dir.$_GET['file'])){
if(is_writeable(dir.$_GET['file'])){
$content = file_get_contents(dir.$_GET['file']);
?>
<form action="?ac=editfile" method="post">
<input type="hidden" name="file" value="'.$_GET['file'].'"/>
<?php
$oFCKeditor = new FCKeditor('FCKeditor1') ;
$oFCKeditor->BasePath = '/editor/' ;
$oFCKeditor->Value = "$content" ;
$oFCKeditor->Create() ;
?>
<br>
<input type="submit" value="update pagina"/>
</form>
<?
}else{
$text = $lang['file']['no_write_access'];
}
}else{
$text = $lang['file']['does_not_exist'];
}
}else{
$text = $lang['file']['does_not_exist'];
}
}
}else{
$text = $lang['locked'];
}
}else{
$text = $lang['login']['no_acces'];
}
[/code]
[b]OUDE CODE[/b]
[code]
[code]<?php
if(!empty($_SESSION['login'])){
if(!empty($_POST)){
$_GET['file'] = $_POST['file'];
}
if(!file_exists(lock.$_GET['file'])){
if(!empty($_POST)){
if($handle = fopen(dir.$_POST['file'],'w+')){
if(fwrite($handle,stripslashes($_POST['content']))){
$text = $lang['file']['succes'];
}else{
$text = $lang['file']['error'];
}
}else{
$text = $lang['file']['read_error'];
}
}else{
if(!empty($_GET['file'])){
if(file_exists(dir.$_GET['file'])){
if(is_writeable(dir.$_GET['file'])){
$content = file_get_contents(dir.$_GET['file']);
$text = '<form action="?ac=editfile" method="post">
<input type="hidden" name="file" value="'.$_GET['file'].'"/>
<p>'.$lang['file']['edit_message'].'</p><p>
<textarea name="content" rows="20" cols="100" name="styled-textarea" id="styled">'.$content.'</textarea><br />
<input type="submit" value="'.$lang['file']['update'].'"/></p></form>';
}else{
$text = $lang['file']['no_write_access'];
}
}else{
$text = $lang['file']['does_not_exist'];
}
}else{
$text = $lang['file']['does_not_exist'];
}
}
}else{
$text = $lang['locked'];
}
}else{
$text = $lang['login']['no_acces'];
}
[/code]
Alvast bedankt
include_once("fckeditor/fckeditor.php") ;
?>
<?php
if(!empty($_SESSION['login'])){
if(!empty($_POST)){
$_GET['file'] = $_POST['file'];
}
if(!file_exists(lock.$_GET['file'])){
if(!empty($_POST)){
if($handle = fopen(dir.$_POST['file'],'w+')){
if(fwrite($handle,stripslashes($_POST['content']))){
$text = $lang['file']['succes'];
}else{
$text = $lang['file']['error'];
}
}else{
$text = $lang['file']['read_error'];
}
}else{
if(!empty($_GET['file'])){
if(file_exists(dir.$_GET['file'])){
if(is_writeable(dir.$_GET['file'])){
$content = file_get_contents(dir.$_GET['file']);
?>
<form action="?ac=editfile" method="post">
<input type="hidden" name="file" value="'.$_GET['file'].'"/>
<?php
$oFCKeditor = new FCKeditor('FCKeditor1') ;
$oFCKeditor->BasePath = '/editor/' ;
$oFCKeditor->Value = "$content" ;
$oFCKeditor->Create() ;
?>
<br>
<input type="submit" value="update pagina"/>
</form>
<?
}else{
$text = $lang['file']['no_write_access'];
}
}else{
$text = $lang['file']['does_not_exist'];
}
}else{
$text = $lang['file']['does_not_exist'];
}
}
}else{
$text = $lang['locked'];
}
}else{
$text = $lang['login']['no_acces'];
}
[/code]
[b]OUDE CODE[/b]
[code]
[code]<?php
if(!empty($_SESSION['login'])){
if(!empty($_POST)){
$_GET['file'] = $_POST['file'];
}
if(!file_exists(lock.$_GET['file'])){
if(!empty($_POST)){
if($handle = fopen(dir.$_POST['file'],'w+')){
if(fwrite($handle,stripslashes($_POST['content']))){
$text = $lang['file']['succes'];
}else{
$text = $lang['file']['error'];
}
}else{
$text = $lang['file']['read_error'];
}
}else{
if(!empty($_GET['file'])){
if(file_exists(dir.$_GET['file'])){
if(is_writeable(dir.$_GET['file'])){
$content = file_get_contents(dir.$_GET['file']);
$text = '<form action="?ac=editfile" method="post">
<input type="hidden" name="file" value="'.$_GET['file'].'"/>
<p>'.$lang['file']['edit_message'].'</p><p>
<textarea name="content" rows="20" cols="100" name="styled-textarea" id="styled">'.$content.'</textarea><br />
<input type="submit" value="'.$lang['file']['update'].'"/></p></form>';
}else{
$text = $lang['file']['no_write_access'];
}
}else{
$text = $lang['file']['does_not_exist'];
}
}else{
$text = $lang['file']['does_not_exist'];
}
}
}else{
$text = $lang['locked'];
}
}else{
$text = $lang['login']['no_acces'];
}
[/code]
Alvast bedankt
Gewijzigd op 01/01/1970 01:00:00 door Matthias van Turennout
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
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
<?php
include_once ("fckeditor/fckeditor.php");
if (!empty($_SESSION['login'])) {
if (!empty($_POST)) {
$_GET['file'] = $_POST['file'];
}
if (!file_exists(lock . $_GET['file'])) {
if (!empty($_POST)) {
if ($handle = fopen(dir . $_POST['file'], 'w+')) {
if (fwrite($handle, stripslashes($_POST['content']))) {
$text = $lang['file']['succes'];
} else {
$text = $lang['file']['error'];
}
} else {
$text = $lang['file']['read_error'];
}
} else {
if(!empty($_GET['file'])) {
if(file_exists(dir . $_GET['file'])) {
if(is_writeable(dir . $_GET['file'])) {
$content = file_get_contents(dir . $_GET['file']);
?>
<form action="?ac=editfile" method="post">
<input type="hidden" name="file" value="<?php echo $_GET['file']; ?>"/>
<?php
$oFCKeditor = new FCKeditor('FCKeditor1');
$oFCKeditor->BasePath = '/editor/';
$oFCKeditor->Value = $content;
$oFCKeditor->Create();
?>
<br>
<input type="submit" value="update pagina"/>
</form>
<?php
} else {
$text = $lang['file']['no_write_access'];
}
} else {
$text = $lang['file']['does_not_exist'];
}
} else {
$text = $lang['file']['does_not_exist'];
}
}
} else {
$text = $lang['locked'];
}
} else {
$text = $lang['login']['no_acces'];
}
?>
include_once ("fckeditor/fckeditor.php");
if (!empty($_SESSION['login'])) {
if (!empty($_POST)) {
$_GET['file'] = $_POST['file'];
}
if (!file_exists(lock . $_GET['file'])) {
if (!empty($_POST)) {
if ($handle = fopen(dir . $_POST['file'], 'w+')) {
if (fwrite($handle, stripslashes($_POST['content']))) {
$text = $lang['file']['succes'];
} else {
$text = $lang['file']['error'];
}
} else {
$text = $lang['file']['read_error'];
}
} else {
if(!empty($_GET['file'])) {
if(file_exists(dir . $_GET['file'])) {
if(is_writeable(dir . $_GET['file'])) {
$content = file_get_contents(dir . $_GET['file']);
?>
<form action="?ac=editfile" method="post">
<input type="hidden" name="file" value="<?php echo $_GET['file']; ?>"/>
<?php
$oFCKeditor = new FCKeditor('FCKeditor1');
$oFCKeditor->BasePath = '/editor/';
$oFCKeditor->Value = $content;
$oFCKeditor->Create();
?>
<br>
<input type="submit" value="update pagina"/>
</form>
<?php
} else {
$text = $lang['file']['no_write_access'];
}
} else {
$text = $lang['file']['does_not_exist'];
}
} else {
$text = $lang['file']['does_not_exist'];
}
}
} else {
$text = $lang['locked'];
}
} else {
$text = $lang['login']['no_acces'];
}
?>
var_dump() overigens $_POST eens nadat je het formulier hebt verstuurd.
Gewijzigd op 01/01/1970 01:00:00 door Jesper Diovo
Quote:
array(2) { ["file"]=> string(8) "home.htm" ["FCKeditor1"]=> string(13) "
Lorem ipsum
" }
Lorem ipsum
" }
Het ingetypte is Lorem ipsum
ik krijg nu nog steeds mijn eigen melding als het niet gelukt is
} else {
$text = $lang['file']['error'];
heeft iemand enig idee?
Gewijzigd op 01/01/1970 01:00:00 door Matthias van Turennout
veranderen in
Denk dat dat wel gaat werken.
werkt nu prima hartstikke bedankt!!!