NOVINKA - Vstup do světa AI s ONLINE víkendovým kurzem Práce s umělou inteligencí od A do Z. Přihlas se ještě dnes!
NOVINKA - Online rekvalifikační kurz Java programátor. Oblíbená a studenty ověřená rekvalifikace - nyní i online.
Avatar
Matěj
Neregistrovaný
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>

 
Odpovědět
23.10.2013 15:06
Děláme co je v našich silách, aby byly zdejší diskuze co nejkvalitnější. Proto do nich také mohou přispívat pouze registrovaní členové. Pro zapojení do diskuze se přihlas. Pokud ještě nemáš účet, zaregistruj se, je to zdarma.

Zobrazeno 1 zpráv z 1.