Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 50 lines (41 sloc) 1.4 kB
01a7f58 @rosslagerwall Initial commit
authored
1 <?php
2 include("common.php");
3
4 $name = stripslashes($_POST['name']);
5 $name = str_replace("\n","",$name);
6 $name = str_replace("\r\n","",$name);
7 $name = str_replace("\r","",$name);
8 $name = str_replace("~","",$name);
9 $description = stripslashes($_POST['description']);
10 $description = str_replace("\n","",$description);
11 $description = str_replace("\r\n","",$description);
12 $description = str_replace("\r","",$description);
13 $description = str_replace("~","",$description);
14 $description = substr($description,3,strlen($description)-7);
15
16 if (trim($name) == "")
17 {
18 header("Location: addForum.php?error=1");
19 exit();
20 }
21 if (trim($description) == "")
22 {
23 header("Location: addForum.php?error=2");
24 exit();
25 }
26
27 $forumId = trim(file_get_contents("db/forumNo.dat"));
28
29 $fh = fopen("db/forumList.dat","a");
30 fwrite($fh,$forumId."~".$name."~".$description."~0~0\n");
31 fclose($fh);
32
33 file_put_contents("db/Topics/".$forumId.".dat","");
34 file_put_contents("db/Topics/".$forumId."sticky.dat","");
35
36 file_put_contents("db/forumNo.dat",($forumId+1)."\n");
37
38 //***********************
39 $fileC = file("db/forumStatistics.dat",FILE_IGNORE_NEW_LINES);
40 $fileC[0] = trim($fileC[0]) + 1;
41 $str = "";
42 foreach ($fileC as $statistic)
43 {
44 $str .= $statistic."\n";
45 }
46 file_put_contents("db/forumStatistics.dat",$str);
47
48 header("Location: index.php");
49 ?>
Something went wrong with that request. Please try again.