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
|
<?php
session_start();
//Ici, vérification de la connexion de l'utilisateur (on est dans une page d'administration donc il faut bien)
if (isset($_POST['source']) && !empty($_POST['source'])){
//Le formulaire a été validé, on enregistre les modifications
fwrite(fopen($fichier, 'w'), $_POST['source']);
}
require_once('fckeditor.php');//inclusion de la classe FCKEditor
$contenuFichierTexte = fread(fopen($fichier, "r"), filesize($fichier));
?>
<html>
<head>
</head>
<body>
<form id='formModifTexte' method='post' action='<?php echo $_SERVER['PHP_SELF'];?>'>
<?php
$oFCKeditor = new FCKeditor('source') ;
$oFCKeditor->ToolbarSet = "Default";
$oFCKeditor->Height = 400;
$oFCKeditor->BasePath = $FCKBasePath ;
$oFCKeditor->Value = $contenuFichierTexte ;
$oFCKeditor->Create() ;
?>
<br/>
<input type='submit' value='valider' />
</form>
</body>
</html> |
Partager