-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforward.php
More file actions
34 lines (21 loc) · 804 Bytes
/
forward.php
File metadata and controls
34 lines (21 loc) · 804 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
/*
(c) 2006 Reed Morse <firstname.lastname at gmail.com>
and Pau Santesmasses <firstname at lastname.net>
*/
require("functions.php");
require("configuration.php");
connect();
// Fetch Keys
$keys = explode("/", $_SERVER['REQUEST_URI']);
// Fetch URL
$query = "SELECT * FROM `".$main_table."` WHERE `key1`='".$keys['2']."' AND `key2`='".$keys['3']."' AND `key3`='".$keys['4']."' AND `key4`='".$keys['5']."' AND `key5`='".$keys['6']."'";
$result = mysql_query($query);
$array = mysql_fetch_array($result);
// Update click-throughs
$array['clicks-aug'] = $array['clicks']+1;
$query_update_clicks = "UPDATE `".$main_table."` SET `clicks`='".$array['clicks-aug']."' WHERE `id`='".$array['id']."'";
mysql_query($query_update_clicks);
// Forward
header("Location:".$array['target']);
?>