mv map_prof plugin inside plugins container
This commit is contained in:
18
plugins/map_prof/utils/mp_get_ip.php
Normal file
18
plugins/map_prof/utils/mp_get_ip.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
function mp_get_ip() {
|
||||
$external_ip = "";
|
||||
// curl with php :
|
||||
// https://www.php.net/manual/en/function.curl-init.php
|
||||
$ch = curl_init('https://ifconfig.me/ip');
|
||||
// CURLOPT_RETURNTRANSFER is set to true, which means that cURL should return the response from the HTTP request as a string, rather than printing it to the screen
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
$external_ip = curl_exec($ch);
|
||||
//mp_console_log("ip:");
|
||||
//mp_console_log($external_ip);
|
||||
curl_close($ch);
|
||||
|
||||
return $external_ip;
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user