-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathEdit-Post-Events.php
51 lines (30 loc) · 1.1 KB
/
Edit-Post-Events.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
<?php
session_start();
include('config.php');
if(isset($_POST['edit']))
{
$post_id = $_POST['post_id'];
$post_hash = $_POST['hash-tag'];
$post_caption = $_POST['caption'];
$invite_link = $_POST['invite-link'];
$event_date = $_POST['event-date'];
$event_time = $_POST['time'];
Update_Post($post_id, $post_caption, $post_hash, $invite_link, $event_date, $event_time);
}
else{
}
function Update_Post($post_id, $post_caption, $post_hash, $invite_link, $event_date, $event_time)
{
include 'config.php';
$SQL = "UPDATE events SET Caption = '$post_caption', HashTags = '$post_hash', Event_Time = '$event_time', Invite_Link = '$invite_link', Event_Date = '$event_date' WHERE Event_ID = $post_id;";
$stmt = $conn->prepare($SQL);
if ($stmt->execute()) {
$send = "Single-Event.php?post_id=$post_id&success_message=Current Post Updated Successfully";
header("location: $send");
exit;
} else {
$send = "Single-Event.php?post_id=$post_id&error_message=Problem With Post Update";
header("location: $send");
exit;
}
}