<?php
//editaction.php

foreach($_POST as $k => $v){
	${"$k"} = $v;
}
//fileuploader.php
if($_FILES){
  $target_path = "external/images/cms/";
  $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); 
  if(! file_exists("$target_path$filename")){
  	move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path);
  }
}
else{
	$string = stripslashes($editor);
  $filename = "$site/$page.html";
  $handle = fopen($filename,"w");
  fwrite($handle,$string,strlen($string));
  fclose($handle);
  header("location: editor.php?r=$filename");
}
?>