test phase
diff --git a/utils.php b/utils.php
new file mode 100644
index 0000000..c3a9620
--- /dev/null
+++ b/utils.php
@@ -0,0 +1,24 @@
+<?php
+function generateRandomString($length = 96) {
+ $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
+ $charactersLength = strlen($characters);
+ $randomString = '';
+ for ($i = 0; $i < $length; $i++) {
+ $randomString .= $characters[rand(0, $charactersLength - 1)];
+ }
+ return $randomString;
+}
+
+function getClientIP():string
+{
+ $keys=array('HTTP_CLIENT_IP','HTTP_X_FORWARDED_FOR','HTTP_X_FORWARDED','HTTP_FORWARDED_FOR','HTTP_FORWARDED','REMOTE_ADDR');
+ foreach($keys as $k)
+ {
+ if (!empty($_SERVER[$k]) && filter_var($_SERVER[$k], FILTER_VALIDATE_IP))
+ {
+ return $_SERVER[$k];
+ }
+ }
+ return false;
+}
+?>