blob: 92c17f810c218ae161a82001d338d56d8286723d (
plain)
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
|
<?php
if (substr_count($_SERVER[HTTP_ACCEPT_ENCODING], gzip))
ob_start(ob_gzhandler);
else ob_start();
?>
<title>KISSmo Archive</title>
<link rel="stylesheet" href="./style.css">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="HandheldFriendly" content="true">
<center><h2>Runing KISSmo Paste</h2></center><br>
<center><form method="POST" action="archive.php" class="search" enctype="multipart/form-data" autocomplete="off">
<input type="text" name="query" maxlength=75 class="searchbox" minlength=3 placeholder="Enter keywords" required>
<input type="submit" value="Search"></input>
</form></center>
<?php
//*$zer = system('grep -l ' . escapeshellarg($_POST['query']) . ' *p/*.txt');
if(isset($_POST['query'])) { //only do file operations when appropriate
echo "<pre class='cmdbox'>";
system('grep -l ' . escapeshellarg($_POST['query']) . ' *p/*.txt');
echo "</pre><br>";
}
?>
<center><a href="./">Paste</a> | <a href="./archive.php">Archive</a></center>
<?php
// Set the current working directory
$directory = getcwd()."/p/";
// Initialize filecount variavle
$filecount = 0;
$files2 = glob( $directory ."*" );
if( $files2 ) {
$filecount = count($files2);
}
echo "Currently archiving: ";
echo $filecount . " paste files ";
echo "<br><br>";
$dir_open = opendir('./p/');
while(false !== ($filename = readdir($dir_open))){
if($filename != "." && $filename != ".."){
$link = "<a href='./p/$filename' target='_blank'> $filename </a><br />";
echo $link;
}
}
closedir($dir_open);
?>
|