<?php
// In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead
// of $_FILES.
include ("../inc/header.inc");
include ("../inc/functions.inc");
$uploaddir = '/var/www/uploads/';
$uploadfile = $uploaddir . $_FILES['userfile']['name'];
$target = '/etc/ha.d/conf/ldirectord.cf';
print "<pre>";
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $target)) {
print "Thanks, the new config file has been uploaded to $target. ";
//print "Here's some more debugging info:\n";
//print_r($_FILES);
} else {
print "Possible file upload attack! Here's some debugging info:\n";
print_r($_FILES);
}
print "</pre>";
?>