-
Notifications
You must be signed in to change notification settings - Fork 2
/
paste.php
56 lines (49 loc) · 1.53 KB
/
paste.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
<?php
// Import config.php
require_once("config.php");
if(!isset($_GET["p"])){
exit("Error p not defined.");
}
$content = "";
if($stmt = mysqli_prepare($mysqli, "SELECT content FROM pastes WHERE id = ?")){
mysqli_stmt_bind_param($stmt, "s", $param_id);
$param_id = $_GET["p"];
mysqli_stmt_execute($stmt);
mysqli_stmt_store_result($stmt);
mysqli_stmt_bind_result($stmt, $temp_content);
while( $stmt->fetch() ) {
$content = $temp_content;
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Paste</title>
<link href="assets/css/style.css" rel="stylesheet" type="text/css">
<link href="assets/css/responsive.css" rel="stylesheet" type="text/css">
<script src="assets/js/darkmode.js"></script>
<style id="darkmode">
<?php
include("assets/css/darkmode.php");
?>
</style>
</head>
<body>
<div class="darkmode_button" onclick="switchdarkmode();"></div>
<div class="header">
<a href="/"><h1>Paste</h1></a>
</div>
<div class="wrapper">
<form>
<textarea name="content" readonly><?php echo htmlspecialchars($content); ?></textarea>
</form>
</div>
<div class="footer">
<h3>Made with ❤️ by Paste</h3>
</div>
</body>
</html>