Added initial files

This commit is contained in:
gyurix
2023-05-23 18:18:36 +02:00
parent a57795594f
commit e2107f4725
69 changed files with 17370 additions and 0 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;
}
}
}
}
?>