1 | <?php
|
---|
2 |
|
---|
3 | /***************************************************************************
|
---|
4 | * Dolphin Smart Community Builder
|
---|
5 | * -----------------
|
---|
6 | * begin : Mon Mar 23 2006
|
---|
7 | * copyright : (C) 2006 BoonEx Group
|
---|
8 | * website : http://www.boonex.com/
|
---|
9 | * This file is part of Dolphin - Smart Community Builder
|
---|
10 | *
|
---|
11 | * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License.
|
---|
12 | * http://creativecommons.org/licenses/by/3.0/
|
---|
13 | *
|
---|
14 | * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
---|
15 | * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
---|
16 | * See the Creative Commons Attribution 3.0 License for more details.
|
---|
17 | * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin,
|
---|
18 | * see license.txt file; if not, write to marketing@boonex.com
|
---|
19 | ***************************************************************************/
|
---|
20 |
|
---|
21 | require_once( 'inc/header.inc.php' );
|
---|
22 | require_once( BX_DIRECTORY_PATH_INC . 'db.inc.php' );
|
---|
23 |
|
---|
24 | $ID = urldecode($_SERVER['QUERY_STRING']);
|
---|
25 | $ID = (int)$ID;
|
---|
26 |
|
---|
27 | $bann_arr = db_arr("SELECT `ID`, `Url` FROM `sys_banners` WHERE `ID` = $ID LIMIT 1");
|
---|
28 | $ID = (int)$bann_arr['ID'];
|
---|
29 | $Url = $bann_arr['Url'];
|
---|
30 |
|
---|
31 | if ( $ID > 0 )
|
---|
32 | {
|
---|
33 | db_res("INSERT INTO `sys_banners_clicks` SET `ID` = $ID, `Date` = ".time().", `IP` = '". $_SERVER['REMOTE_ADDR']. "'", 0);
|
---|
34 |
|
---|
35 | header ("HTTP/1.1 301 Moved Permanently");
|
---|
36 | header ("Location: $Url");
|
---|
37 | exit;
|
---|
38 | }
|
---|
39 | else
|
---|
40 | {
|
---|
41 | echo "No such link";
|
---|
42 | }
|
---|
43 |
|
---|
44 | ?> |
---|