Location: PHPKode > projects > Ajax File Manager - AjaxExplorer > ajaxexplorer/script/editor.php
<?php

/*
AjaxExplorer Copyright (C) 2007-2008 Syed Mohammad Sidque Tahir Al-Habshi

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Head to
GNU site http://www.gnu.org/licenses/ for license copy.
*/

$access='0002';
include 'core.php';

if(isset($_POST['load'])) $_SESSION['editor']=$_POST['load'];
if(isset($_POST['stop'])) exit;

$load=isset($_SESSION['editor'])? $_SESSION['editor']:'';

if(isset($_POST['save']))
{
  $file=Post('file');

  $does="Edit\t".$file;
  include 'track.php';

  $file=fopen($file, 'w+');
  $text=str_replace(array("&", ":A:", ":B:", ":N:", ":T:"), array("*", "+", "&", "\r\n", "\t"), stripslashes(Post('save')));
  fwrite($file, $text);
  fclose($file);
}

echo isset($text)? $text:(file_exists($load)? file_get_contents($load):'?');

?>
Return current item: Ajax File Manager - AjaxExplorer