<?php require_once 'init.php'; loadScripts(); $data = array("status" => "not set!"); if (Utils::isGET()) { $pm = new ProductManager(); $rows = $pm->addProducts($_GET['sku'], $_GET['name'], $_GET['price'], $_GET['stock'], $_GET['path'], $_GET['description']); } else { $data = array("status" => "error", "msg" => "Only GET allowed."); } echo json_encode($data, JSON_FORCE_OBJECT);