require_once 'classes/inject_record.php'; if (!isset($_SESSION['name'])) { header('Location:index.php?login=login'); } if (isset($_POST['submit'])) { //print_r($_POST); foreach ($_POST as $key => $value) { if (empty($_POST[$key])) { $error = 'Fill empty fields first.'; } else { $data[$key] = $value; } } if (!isset($error)) { $obj = new inject_record(); $add_result = $obj->add_uc(); } } $obj = new inject_record(); $result = $obj->get_uc(); //print_r($result); ?> <!DOCTYPE html> <!-- To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor. --> <html> <head> <title>Add Uc</title>