-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathviewcode.php
76 lines (75 loc) · 2.42 KB
/
viewcode.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
<?php
if(isset($_GET['id']))
{
$uid = $_GET['id'];
$searchres = false;
$title = "Not found";
include("pdoconnect.php");
$query = $conn->prepare("SELECT `title`, `language`, `pastecode` FROM `paste` WHERE `uid` = ?");
$query->execute(array($uid));
if($query->rowCount() == 0)
{
$searchres = true;
}
else
{
include("geshi/geshi.php");
$row = $query->fetch(PDO::FETCH_ASSOC);
$title = $row['title'];
$source = $row['pastecode'];
$language = $row['language'];
$path = '';
$geshi = new GeSHi($source, $language, $path);
}
}
else
{
header("Location: http://yourwebsite.com");
exit();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo htmlentities($title); ?></title>
<link rel="stylesheet" type="text/css" href="http://scriptings.tk/css/style2.css" /></head>
</head>
<body>
<div align="center">
<pre style="text-shadow: 2px 2px #000000;">
_________ .__ __ .__
/ _____/ ___________|__|______/ |_|__| ____ ____ ______
\_____ \_/ ___\_ __ \ \____ \ __\ |/ \ / ___\/ ___/
/ \ \___| | \/ | |_> > | | | | \/ /_/ >___ \
/_______ /\___ >__| |__| __/|__| |__|___| /\___ /____ >
\/ \/ |__| \//_____/ \/ </pre>
</div>
<div style="text-shadow: 2px 2px #000000;" align="left">
<form action="search.php" method="post">
<p align="right">
<a style="text-decoration: none; font-weight: bold;color: white;" href="http://scriptings.tk/paste">Home</a>
<input type="text" class="Input" name="search" placeholder="Search item" />
<input type="submit" class="Button" name="submit" value="Search"/></p>
</form>
<hr />
</div>
<div style="text-shadow: 2px 2px #000000;" cols="40" align="left">
<?php
if($searchres)
{
echo '<span style="color: red">Invalid id</span>';
exit();
}
?>
<span style="color: green">Language : <?php echo htmlentities($language); ?></span><br />
</div>
<?php
$geshi->set_overall_style('background-color: #ffffee;', true);
$out = $geshi->parse_code();
$out = str_replace('style="font-family:monospace;background-color: #ffffee;"',
'style="font-family:monospace;background-color: #ffffee;color: #000000;"', $out);
echo $out;
?>
</body>
</html>