PHP Classes

File: editor.php

Recommend this page to a friend!
  Classes of Fernando Alls   PHP Editor   editor.php   Download  
File: editor.php
Role: Example script
Content type: text/plain
Description: editor of system
Class: PHP Editor
Store in MySQL HTML content edited on the browser
Author: By
Last change:
Date: 12 years ago
Size: 1,102 bytes
 

Contents

Class file image Download
<?php

/*
*
*
* Delete file
*
*/
if(@$_GET['delete'] && is_numeric($_GET['delete']))
  {
  
$id = $_GET['delete'];
  
   require_once(
'core.class.php');
  
$editor = new Editor();
  
$editor->delete($id);
  }

 
 
/*
*
* Edit file
*
*
*/
else if(@$_GET['edit'] && is_numeric($_GET['edit']))
  {
  
$id = $_GET['edit'];

   require_once(
'core.class.php');
  
$editor = new Editor();
?>
<script type="text/javascript" src="js/nicEdit.js"></script>
<script type="text/javascript">
    bkLib.onDomLoaded(function() { nicEditors.allTextAreas() });
</script>
<form action="" method="post">
<textarea name="content" cols="100" rows="20">
  <?php
   
     $editor
->Read($id);
 
 
?>
</textarea>
<input type="hidden" name="id" value="<?php echo $editor->id; ?>">
<input type="hidden" name="send">
<input type="submit" value="Update">
</form>
<?php
if(isset($_POST['send'])){
  require_once(
'core.class.php');
 
$id = $_POST['id'];
 
$conteudo = $_POST['content'];

 
$update = new Editor();
 
$update->update($id, $conteudo);
 }
?>

<?php
 
}
?>