-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimeo.php
63 lines (53 loc) · 1.36 KB
/
vimeo.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
58
59
60
61
62
63
<?php
ob_start();
$hostname = 'localhost';
$username = 'txmafia_athwt';
$password = 'Txvbs9HNtNNJLFE7';
$database = 'txmafia_athwt';
$errors = array();
$id = isset($_GET['id']) !== false && preg_match('/^[a-z0-9]+$/i', $_GET['id']) === 1 ? $_GET['id'] : false;
if ($id !== false) {
$link = mysql_connect($hostname, $username, $password);
if ($link !== false) {
if (mysql_select_db($database, $link) !== false) {
$sql = "
SELECT
e.id_vimeo,
e.id_key,
e.name,
e.name_short,
s.name AS season
FROM
episode AS e LEFT JOIN
season AS s ON
e.id_season = s.id
WHERE
id_key = '" . $id . "'
";
$result = mysql_query($sql, $link);
if ($result !== false) {
if (mysql_num_rows($result) === 1) {
$success = true;
$OUT = mysql_fetch_assoc($result);
include_once 'html/vimeo.html';
} else {
$errors[] = 'Wallpaper does not exist.';
}
} else {
$errors[] = 'Unable to query server.';
}
} else {
$errors[] = 'Unable to connect to database.';
}
} else {
$errors[] = 'Unable to connect to server.';
}
} else {
$errors[] = 'Inavlid episode key.';
}
header('X-JSON: ({"success":' . (sizeof($errors) === 0 ? 'true' : 'false') . '})');
if (sizeof($errors) > 0) {
var_dump($errors);
}
ob_end_flush();
?>