Created
September 6, 2021 19:48
-
-
Save andi34/1463916b84eecc80d801495c033c87c3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once '../lib/config.php'; | |
if ($os == 'linux') { | |
$get_ip = shell_exec('hostname -I | cut -d " " -f 1'); | |
if (!$get_ip) { | |
$IP = $_SERVER['HTTP_HOST']; | |
} else { | |
$IP = $get_ip; | |
} | |
} else { | |
$IP = 'can not detect on Windows!'; | |
} | |
echo "Your IP: $IP"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment