. */ header("Content-type: text/plain"); require_once("lib/util.php"); require_once("lib/data.php"); class Upload { private $data; function __construct() { $this->data = getPost("data"); } private function validate() { if ($this->data == NULL) { echoln("Missing data param"); return false; } return true; } private function writeData() { $datas = explode(',', $this->data); foreach($datas as $data) { data_add($data); } } public function run() { if ($this->validate()) $this->writeData(); } } $upload = new Upload(); $upload->run();