-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.php
57 lines (32 loc) · 1.63 KB
/
config.php
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
$mysql_host = "HOST";
$mysql_database = "DB";
$mysql_user = "USER";
$mysql_password = "PWD";
$link = mysql_connect("$mysql_host", "$mysql_user", "$mysql_password") or die("Could not connect : " . mysql_error());
mysql_query('SET CHARSET UTF8');
mysql_query('SET NAMES UTF8');
mysql_select_db("$mysql_database") or die("Could not select database");
$query1 = mysql_query("SELECT * FROM admin WHERE name = 'pass'");
$query2 = mysql_query("SELECT * FROM admin WHERE name = 'papka'");
$query3 = mysql_query("SELECT * FROM admin WHERE name = 'filesize'");
$query8 = mysql_query("SELECT * FROM images WHERE p = '0' ORDER BY id DESC LIMIT 5");
$language = strtolower(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2));
$row1 = mysql_fetch_array($query1);
$row2 = mysql_fetch_array($query2);
$row3 = mysql_fetch_array($query3);
session_start();
if (!isset($_COOKIE['lang'])) {
setcookie('lang', $language, time() + 3600000);
}
if ($_COOKIE["PHPSESSID"]) {
setcookie("PHPSESSID", session_id(), time() + (3600 * 24 * 60 * 60));
}
$url = "http://" . $_SERVER['HTTP_HOST'] . "/";
$razmer = "$row3[value]";
$papka = "$row2[value]";
$ip = getenv("REMOTE_ADDR");
$date = date("Y-m-d H:i:s");
$ca["category"] = array("nocat" => "1", "funny" => "2", "animals" => "3", "politics" => "4", "girls" => "5", "lessons" => "6", "scary" => "7");
$russian_cat = array("Без категории", "Смешное", "Животные", "Политика", "Девушки", "Учеба", "Страшное", "Другое");
?>