Post registration hook
diff --git a/config.php.example b/config.php.example
index c873baa..037df68 100755
--- a/config.php.example
+++ b/config.php.example
@@ -97,5 +97,10 @@
 // url to redirect to after mail confirmation. It will be 5 seconds of delay. Leave empty to none
 $REDIRECT_TO = "";
 
+// Registration callback. A function to run when registration is successfull
+$POST_REGISTER_HOOK = function(){
+  echo "THE IP: " . $_SERVER['REMOTE_ADDR'];
+};
+
 // displays php errors on the html page. Set to false for production
 $DEBUG = false;
diff --git a/index.php b/index.php
index e1b57df..efe0040 100755
--- a/index.php
+++ b/index.php
@@ -273,6 +273,7 @@
                         }
                         redis_inc_ipdata(getClientIP(), "register");
                         echo $STRINGS->email_confirmation;
+                        if (isset($POST_REGISTER_HOOK)) $POST_REGISTER_HOOK($user);
                         include $TEMPLATE . "mail_confirmed.htm";
                     } else {
                         echo $STRINGS->email_confirmation;