OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
/
eSamudaay
/
inc
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
10/10/2024 10:20:39 AM
rwxr-xr-x
📁
PHPMailer
-
08/29/2024 12:14:12 PM
rwxr-xr-x
📄
bcommon.js
40.38 KB
08/29/2024 12:14:11 PM
rw-r--r--
📄
bconfig.php
10.12 KB
08/29/2024 12:14:11 PM
rw-r--r--
📄
common.js
41.63 KB
08/29/2024 12:14:11 PM
rw-r--r--
📄
config.php
18.75 KB
08/29/2024 12:14:11 PM
rw-r--r--
📁
fontawesome
-
08/29/2024 12:14:24 PM
rwxr-xr-x
📄
function.php
2.8 KB
08/29/2024 12:14:11 PM
rw-r--r--
📄
genai_func.js
13.09 KB
08/29/2024 12:14:11 PM
rw-r--r--
📄
genai_style.css
3.13 KB
08/29/2024 12:14:11 PM
rw-r--r--
📄
grayscale.min.css
4.55 KB
08/29/2024 12:14:11 PM
rw-r--r--
📄
handler.php
5.02 KB
08/29/2024 12:14:11 PM
rw-r--r--
📄
hhandler.php
4.51 KB
08/29/2024 12:14:11 PM
rw-r--r--
📄
jquery.magnific-popup.min.js
19.74 KB
08/29/2024 12:14:11 PM
rw-r--r--
📄
magnific-popup.css
6.79 KB
08/29/2024 12:14:11 PM
rw-r--r--
📄
old_genai_func.js
10.34 KB
08/29/2024 12:14:11 PM
rw-r--r--
📄
old_genai_style.css
2.21 KB
08/29/2024 12:14:12 PM
rw-r--r--
📄
oldcommon.js
45.07 KB
08/29/2024 12:14:11 PM
rw-r--r--
📄
repconfig.php
16.79 KB
08/29/2024 12:14:12 PM
rw-r--r--
📁
simplepie
-
08/29/2024 12:14:24 PM
rwxr-xr-x
📄
style.css
7.75 KB
08/29/2024 12:14:12 PM
rw-r--r--
📄
validate.logged.php
433 bytes
08/29/2024 12:14:12 PM
rw-r--r--
📄
zconfig.php
9.7 KB
08/29/2024 12:14:12 PM
rw-r--r--
📄
zzconfig.php
10.02 KB
08/29/2024 12:14:12 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); }