lepisi-pengumuman/Core/Input.php

36 lines
475 B
PHP

<?php
namespace Core;
class Input
{
public static function exists($type = 'post')
{
switch ($type) {
case 'post':
return (!empty($_POST)) ? true : false;
break;
case 'get':
return (!empty($_GET)) ? true : false;
break;
default:
return false;
break;
}
}
public static function get($item)
{
if(isset($_POST[$item]))
{
return $_POST[$item];
}
elseif(isset($_GET[$item]))
{
return $_GET[$item];
}
return '';
}
}