-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheditpost.php
More file actions
38 lines (32 loc) · 792 Bytes
/
Copy patheditpost.php
File metadata and controls
38 lines (32 loc) · 792 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
31
32
33
34
35
36
37
38
<?php
include 'header.php';
include 'connect.php';
session_start();
$postid=$_GET['id'];
if($_SERVER['REQUEST_METHOD']!='POST')
{
?>
<html>
<head>
<body>
<form name="edit" action="" method="POST">
<textarea name="newpost" placeholder="Type your new reply"></textarea><br>
<input type="submit" value="Change" />
</form>
</body>
</head>
</html>
<?php }
else
{
$newpost=$_POST['newpost'];
$query="UPDATE posts SET post_content='$newpost' WHERE post_id=$postid";
if(mysql_query($query))
{
echo "Your reply has been successfully updated";
}
else
{
echo "Oops.Something went wrong Try again later".mysql_error();
}
}