+// Get referal ID from ref or refid variable
+$ref = 0;
+if (isGetRequestElementSet('ref')) $ref = bigintval(getRequestElement('ref'));
+ elseif (isGetRequestElementSet('refid')) $ref = bigintval(getRequestElement('refid'));
+
+if (!empty($ref)) {
+ // We have an refid here. So we simply add it
+ $URL .= $ref;