-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
183 lines (152 loc) · 4.52 KB
/
index.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<html>
<body>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/base64.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/aes.js" integrity="sha256-/H4YS+7aYb9kJ5OKhFYPUjSJdrtV6AeyJOtTkw6X72o=" crossorigin="anonymous"></script>
<script src="https://gabrielkheisa.xyz/js/qrcode.min.js"></script>
<?php
$servername = "";
$username = "";
$password = "";
$dbname = "";
$sesid = rand(1,999999999);
$cookie_name = "session";
if(!isset($_COOKIE[$cookie_name])) {
//echo "Cookie named '" . $cookie_name . "' is not set!";
$cookie_value = $sesid;
setcookie($cookie_name, $cookie_value, time() + (86400 * 30), "/"); // 86400 = 1 day
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
/*
$sql = "INSERT INTO meme (session, status)
VALUES ('". $sesid ."', '0')";
if ($conn->query($sql) === TRUE) {
// echo "New record created successfully";
}
else {
// echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
*/
}
else {
// echo "Cookie '" . $cookie_name . "' is set!<br>";
// echo "Value is: " . $_COOKIE[$cookie_name];
$sesid = $_COOKIE[$cookie_name];
}
?>
<title>Meme generator</title>
<style>
.center {
margin: auto;
width: 50%;
padding: 10px;
}
body {
transition: 0.5s;
}
img {
display: block;
margin-left: auto;
margin-right: auto;
}
@media only screen and (max-width: 1100px){
body {
font-size:4em;
}
video {
width:100%;
}
h2 {
font-size:1.5em;
text-align: center;
}
h4 {
font-size:0.8em;
}
h5 {
font-size:0.8em;
}
input {
font-size:1em !important;
}
select {
font-size:0.8em !important;
}
.center {
margin: 5px;
width: 100%;
padding: 10px;
}
#tombol{
font-size:1em !important;
}
.progress {
height:50px !important;
}
}
</style>
<?php
$fileContent = file_get_contents("teks.txt");
if($fileContent != "S0VUSUtBIDEsS0VUSUtBIDIsS0VUSUtBIDMsS0VUSUtBIDQsS0VUSUtBIDUsS0VUSUtBIDYsS0VUSUtBIDcsS0VUSUtBIDgsS0VUSUtBIDks"){
echo "Server is busy";
}
else {
echo
"
<video width=\"400\" controls class=\"center\">
<source src=\"contoh.mp4\" type=\"video/mp4\">
Your browser does not support HTML video.
</video>
<br><br>
<div class=\"form-group m-3 center\">
Text 1:<input type=\"text\" id=\"text1\" value=\"KETIKA 1\" oninput=\"gae();\"><br>
Text 2:<input type=\"text\" id=\"text2\" value=\"KETIKA 2\" oninput=\"gae();\"><br>
Text 3:<input type=\"text\" id=\"text3\" value=\"KETIKA 3\" oninput=\"gae();\"><br>
Text 4:<input type=\"text\" id=\"text4\" value=\"KETIKA 4\" oninput=\"gae();\"><br>
Text 5:<input type=\"text\" id=\"text5\" value=\"KETIKA 5\" oninput=\"gae();\"><br>
Text 6:<input type=\"text\" id=\"text6\" value=\"KETIKA 6\" oninput=\"gae();\"><br>
Text 7:<input type=\"text\" id=\"text7\" value=\"KETIKA 7\" oninput=\"gae();\"><br>
Text 8:<input type=\"text\" id=\"text8\" value=\"KETIKA 8\" oninput=\"gae();\"><br>
Text 9:<input type=\"text\" id=\"text9\" value=\"KETIKA 9\" oninput=\"gae();\"><br>
</div>
<br><br>
<form action=\"process.php\" method=\"get\">
<input hidden type=\"text\" id=\"keluaran_\" name=\"hasil\"><br>
<input type=\"submit\">
</form>
";
}
?>
<script>
var nilai = [0,0,0,0,0,0,0,0,0];
var i;
function gae() {
for(i=0;i<=8;i++){
nilai[i] = document.getElementById("text"+String(i+1)).value;
}
}
function cetak() {
var keluaran = "";
for(i=0;i<=8;i++){
keluaran = keluaran + String(nilai[i]).toUpperCase() + ",";
}
document.getElementById("keluaran_").value = Base64.encode(keluaran);
}
timeout();
function timeout() {
setTimeout(function () {
cetak();
timeout();
}, 200);
}
</script>
</body>
</html>