-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathlockExecute.php
More file actions
30 lines (28 loc) · 801 Bytes
/
Copy pathlockExecute.php
File metadata and controls
30 lines (28 loc) · 801 Bytes
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
<?php
if ($_GET['mode'] == 'lock')
{
$fileC = file("db/Topics/".$_GET['topicId']."/topic.dat",FILE_IGNORE_NEW_LINES);
$fileC[6] = "true";
$str = "";
foreach ($fileC as $temp)
{
$str .= $temp."\n";
}
//echo "<xmp>$str</xmp>";
file_put_contents("db/Topics/".$_GET['topicId']."/topic.dat",$str);
header("location: viewPosts.php?topicId=".$_GET['topicId']);
}
else if ($_GET['mode'] == 'unlock')
{
$fileC = file("db/Topics/".$_GET['topicId']."/topic.dat",FILE_IGNORE_NEW_LINES);
$fileC[6] = "false";
$str = "";
foreach ($fileC as $temp)
{
$str .= $temp."\n";
}
//echo "<xmp>$str</xmp>";
file_put_contents("db/Topics/".$_GET['topicId']."/topic.dat",$str);
header("location: viewPosts.php?topicId=".$_GET['topicId']);
}
?>