NOVINKA: Kurz kybernetickej bezpečnosti teraz už od 0 €. Staň sa žiadaným profesionálom. Zisti viac:
NOVINKA: Staň sa dátovým analytikom od 0 € a získaj istotu práce, lepší plat a nové kariérne možnosti. Viac informácií:
Avatar
Matěj
Nevyplnené
Avatar
Matěj:23.10.2013 15:06

Čau lidi, může mě někdo nakopnout? Neukládá se mi Inline editace v CKEditoru, viz. kód.

<head><script src="ckeditor/cke­ditor.js"></scrip­t></head>

<body>

<?php

if (!function_exis­ts('file_put_con­tents')) {
function file_put_conten­ts($filename, $data) {
$f = @fopen($filename, 'w');
if (!$f) {
return false;
} else {
$bytes = fwrite($f, $data);
fclose($f);
return $bytes;
}
}
}

if (!function_exis­ts('file_get_con­tents')) {
function file_get_conten­ts($filename) {
$fhandle = fopen($filename, "r");
$fcontents = fread($fhandle, filesize($file­name));
fclose($fhandle);
return $fcontents;
}
}

function showForm($data = '') {
?>

<form method="post" action="index.php">
<div contenteditable="tru­e" id="uprava"><?php echo htmlspecialchar­s($data, ENT_QUOTES); ?></div>
<input type="submit" value="ulož"></for­m>

<script>
CKEDITOR.inline( 'uprava' );
</script>

<?php
}
if (!isset($_POS­T['index'])) {
showForm(file_get_con­tents('data/in­dex.inc'));
} else {
if (get_magic_qu­otes_gpc()) {
$_POST['index'] = stripslashes($_POS­T['index']);
}
@unlink('.tem­p.html');
file_put_conten­ts('data/temp­.html', $_POST['index']);
unlink('data/in­dex.inc');
rename('data/tem­p.html', 'data/index.inc');
showForm(file_get_con­tents('data/in­dex.inc'));
}
?>

</body>

<script>
CKEDITOR.inline( 'uprava' );
</script>

<?php
}
if (!isset($_POS­T['index'])) {
showForm(file_get_con­tents('data/in­dex.inc'));
} else {
if (get_magic_qu­otes_gpc()) {
$_POST['index'] = stripslashes($_POS­T['index']);
}
@unlink('.tem­p.html');
file_put_conten­ts('data/temp­.html', $_POST['index']);
unlink('data/in­dex.inc');
rename('data/tem­p.html', 'data/index.inc');
showForm(file_get_con­tents('data/in­dex.inc'));
}
?>

</body></html>

 
Odpovedať
23.10.2013 15:06
Robíme čo je v našich silách, aby bola tunajšia diskusia čo najkvalitnejšia. Preto do nej tiež môžu prispievať len registrovaní členovia. Pre zapojenie sa do diskusie sa zaloguj. Ak ešte nemáš účet, zaregistruj sa, je to zadarmo.

Zobrazené 1 správy z 1.