initial commit

This commit is contained in:
2024-08-21 10:39:23 +02:00
parent d8089cd3cf
commit 4e1698a077
73 changed files with 17565 additions and 2 deletions

32
files/helper.php Executable file
View File

@@ -0,0 +1,32 @@
<?php
class Helper
{
function get_IP_address()
{
foreach (array('HTTP_CLIENT_IP',
'HTTP_X_FORWARDED_FOR',
'HTTP_X_FORWARDED',
'HTTP_X_CLUSTER_CLIENT_IP',
'HTTP_FORWARDED_FOR',
'HTTP_FORWARDED',
'REMOTE_ADDR') as $key){
if (array_key_exists($key, $_SERVER) === true){
foreach (explode(',', $_SERVER[$key]) as $IPaddress){
$IPaddress = trim($IPaddress); // Just to be safe
if (filter_var($IPaddress,
FILTER_VALIDATE_IP,
FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)
!== false) {
return $IPaddress;
}
}
return $IPaddress;
}
}
}
}
?>