-
Notifications
You must be signed in to change notification settings - Fork 1
/
tag.php
executable file
·55 lines (50 loc) · 1.24 KB
/
tag.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
<?php
foreach ($_POST as $key=>$value) {
if(strstr($key, "____")){
$txt=substr_replace($key, ".txt", -4);
if(strlen($value)==7){
$v=preg_split('//',$value);
$value=trim(implode(' ',$v));
}
$file=fopen("$samples/".$txt,"w");
fwrite($file, $value);
fclose($file);
}
}
$od=(int)$_GET['od'];
$do=(int)$_GET['do'];
echo '<style type="text/css">
<!--
.i {width: 400px; height: 100px;}
//-->
</style>
<form action="tag.php" method="post">';
$d = dir("samples");
while (false !== ($entry = $d->read())) {
if(strstr($entry, ".jpg")){
#echo $entry."\n";
$txt=substr_replace($entry, "txt", -3);
$png=substr_replace($entry, "png", -3);
$pod=substr_replace($entry, "____", -4);
$id=(int)$entry;
if(($do!=0||$od!=0) &&( $id>$do || $id<$od))continue;
//echo $txt."\n";
if(file_exists("samples/$txt")){
$lines=file("samples/$txt");
if (isset ($lines[0])) {
$data=chop($lines[0]);
}
else {
$data = "";
}
}
else{
$data="";
}
//echo $data."\n";
echo "<image class='i' src=\"samples/$entry\" /> <image class='i' src=\"tmp/$png\" /><br>\n";
echo "<input type=\"text\" name=\"$pod\" value=\"$data\"><br>";
}
}echo "<input type=\"submit\"></form>";
$d->close();
?>