OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
breader
/
inc
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
11/07/2024 07:55:42 AM
rwxr-xr-x
📁
PHPMailer
-
07/27/2024 04:06:35 PM
rwxr-xr-x
📄
bcommon.js
40.38 KB
08/08/2023 10:27:10 AM
rw-r--r--
📄
bconfig.php
10.12 KB
07/05/2024 11:14:48 AM
rw-r--r--
📄
common.js
41.63 KB
08/02/2024 12:02:39 PM
rw-r--r--
📄
config.php
18.75 KB
07/26/2024 06:00:21 AM
rw-r--r--
📁
fontawesome
-
07/27/2024 04:02:26 PM
rwxr-xr-x
📄
function.php
2.8 KB
08/07/2024 10:37:23 AM
rw-r--r--
📄
genai_func.js
13.09 KB
07/15/2024 07:24:32 AM
rw-r--r--
📄
genai_style.css
3.13 KB
07/01/2024 07:28:21 AM
rw-r--r--
📄
grayscale.min.css
4.55 KB
08/16/2020 03:58:30 PM
rw-r--r--
📄
handler.php
5.02 KB
08/02/2024 11:49:22 AM
rw-r--r--
📄
hhandler.php
4.51 KB
08/02/2024 11:49:14 AM
rw-r--r--
📄
jquery.magnific-popup.min.js
19.74 KB
06/05/2017 08:11:48 AM
rw-r--r--
📄
magnific-popup.css
6.79 KB
06/05/2017 08:11:48 AM
rw-r--r--
📄
old_genai_func.js
10.34 KB
06/27/2024 11:56:41 AM
rw-r--r--
📄
old_genai_style.css
2.21 KB
06/27/2024 11:56:41 AM
rw-r--r--
📄
oldcommon.js
45.07 KB
07/02/2024 11:04:36 AM
rw-r--r--
📄
repconfig.php
16.79 KB
07/22/2024 10:59:00 AM
rw-r--r--
📁
simplepie
-
07/27/2024 04:02:32 PM
rwxrwxrwx
📄
style.css
7.75 KB
05/19/2024 04:39:49 PM
rw-r--r--
📄
validate.logged.php
433 bytes
06/06/2021 07:12:13 AM
rw-r--r--
📄
zconfig.php
9.7 KB
04/04/2024 02:35:08 PM
rw-r--r--
📄
zzconfig.php
10.02 KB
07/04/2024 12:55:22 PM
rw-r--r--
Editing: function.php
Close
<? // Enable exception handling for mysqli mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); function find_ipgeo_location() { // Fetch the client's IP address $ip = getenv('HTTP_CLIENT_IP') ?: getenv('HTTP_X_FORWARDED_FOR') ?: getenv('HTTP_X_FORWARDED') ?: getenv('HTTP_FORWARDED_FOR') ?: getenv('HTTP_FORWARDED') ?: getenv('REMOTE_ADDR'); // Default values $visitCity = ''; $visitCountry = ''; // Fetch geolocation data $response = @file_get_contents('http://www.geoplugin.net/php.gp?ip=' . urlencode($ip)); if ($response !== false) { $data = unserialize($response); if ($data && isset($data['geoplugin_city']) && isset($data['geoplugin_countryName'])) { $visitCity = $data['geoplugin_city']; $visitCountry = $data['geoplugin_countryName']; } } // Prepare the response in JSON format $result = [ 'City' => $visitCity, 'Country' => $visitCountry ]; return json_encode($result); } function save_geo_location($db, $id, $ip, $visitCity, $visitCountry) { try { $db->query("INSERT INTO metrics(article_id,ip,visit_city,visit_country,date_visited) VALUES($id,'$ip','$visitCity','$visitCountry',Now())"); } catch (mysqli_sql_exception $e) { return json_encode(['status' => 'error', 'message' => 'Error occured: ' . $e->getMessage()]); } } function fetch_gps_location($latitude, $longitude) { // Nominatim reverse geocoding URL $url = "https://nominatim.openstreetmap.org/reverse?format=json&lat=$latitude&lon=$longitude&addressdetails=1"; // Initialize cURL $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Set a custom User-Agent curl_setopt($ch, CURLOPT_USERAGENT, "YourAppName/1.0 (yourname@example.com)"); // Execute request and get the response $response = curl_exec($ch); // Check for errors if (curl_errno($ch)) { echo 'Error:' . curl_error($ch); curl_close($ch); return null; } // Close cURL curl_close($ch); // Decode the JSON response $data = json_decode($response, true); // Check if the response contains an address if (isset($data['address'])) { return json_encode(["response" => "success" , "address" => $data['address']]); } else { return null; } } if (isset($_POST['action']) && $_POST['action'] === 'gps_loc') { // Validate and sanitize input $lat = filter_var($_POST['lat'], FILTER_VALIDATE_FLOAT); $lon = filter_var($_POST['lon'], FILTER_VALIDATE_FLOAT); if ($lat === false || $lon === false) { echo 'Invalid latitude or longitude'; exit; } echo fetch_gps_location($lat, $lon); }