-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpaste.php
More file actions
54 lines (39 loc) · 1.38 KB
/
paste.php
File metadata and controls
54 lines (39 loc) · 1.38 KB
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
<?php require_once 'crap.php';
if ( isset ( $_GET['c'] ) ) {
$crap_id = doSafe ( $_GET['c'] );
$query = mysqli_query ( db( ), "SELECT * FROM crap WHERE url = '" . $crap_id . "'" );
if ( !$query )
die ( 'Crap! An unexpected error occured.' );
if ( mysqli_num_rows ( $query ) === 0 )
die ( 'This is not a valid ID.' );
$crap = mysqli_fetch_assoc ( $query );
} else {
die ( 'An ID was not supplied.' );
}
if ( isset ( $_GET['plain'] ) ) {
echo ( "<pre>" . $crap['crap'] . "</pre>" );
} else {
?>
<head>
<title>textcrap</title>
<link rel="stylesheet" href="../main.css" type="text/css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
</head>
<center>
<br>
<a href="../index.php" style="text-decoration: none; color: white;"><h1>textcrap</h1></a>
<p style="color: white;">
The easiest way to post your text-based crap online.
</p>
<br>
<input type="text" value="<?php echo $crap['title']; ?>" DISABLED />
<textarea><?php echo $crap['crap']; ?></textarea>
<br>
<a href="?plain=true">Plain text version</a>.
<br><br><br><br><br><br><br><br>
Made with ♥ by <a href="http://cammarata.info">Preston Cammarata</a><br>
<a href="http://github.com/aceriou/textcrap">GitHub Repository</a><br>
Made in Rhode Island.
</center>
<?php } ?>