-// Base URL for redirection
-$URL = 'modules.php?module=index&what=sponsor_login&hash=';
-if (!REQUEST_ISSET_GET('hash')) {
- // No refid and we add our refid (don't forget to set $def_refid!)
- $URL = 'modules.php?module=index';
-} else {
+// No hash provided by default
+$url = 'modules.php?module=index';
+
+// Is there a hash?
+if (isGetRequestElementSet('hash')) {