- $type = substr($url, -3);
- @header ("Content-Type: image/".$type);
- LOAD_URL($url, false);
+ // Update counter
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_refbanner` SET `counter`=`counter`+1 WHERE `id`=%s LIMIT 1",
+ array(bigintval(getRequestElement('banner'))), __FILE__, __LINE__);
+
+ // Set header and ...
+ setContentType('image/' . substr($url, -3, 3));
+
+ // Redirect
+ redirectToUrl($url, false);