-
Notifications
You must be signed in to change notification settings - Fork 2
/
editPost.php
40 lines (35 loc) · 1.03 KB
/
editPost.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
<?php
include("common.php");
$fileC = file("db/Topics/".$_GET['topicId']."/posts.dat",FILE_IGNORE_NEW_LINES);
foreach ($fileC as $line)
{
$temp = new Post($line);
if ($temp->getPostId() == $_GET['postId'])
{
$actual = $temp;
}
}
outHtml1("Edit Post");
?>
<!-- TinyMCE -->
<script type="text/javascript" src="tiny_mce/tiny_mce.js"></script>
<script type="text/javascript" src="tiny_mce_init.js"></script>
<?php
outHtml2("Edit Post:","viewPosts.php?topicId=".$actual->getTopicId());
?>
<form action="editPostExecute.php?topicId=<?php echo htmlentities($_GET['topicId']) ?>&postId=<?php echo htmlentities($_GET['postId']) ?>" method="post">
<div id="messageDiv">
Post Message:<br />
<textarea name="message"><?php echo trim($actual->getMessage()); ?></textarea><br />
<?php
if ($_GET['error'] == 1)
{
echo "<div class='error'>Please enter a post!</div>";
}
?>
<input type="submit" value="Change" />
</div>
</form>
<?php
outHtml3();
?>