-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathaction_indexf.php
More file actions
38 lines (30 loc) · 777 Bytes
/
action_indexf.php
File metadata and controls
38 lines (30 loc) · 777 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
//action.php
$connect = mysqli_connect('localhost', 'root', '***************', 'dbase');
mysqli_set_charset($connect,"utf8");
$input = filter_input_array(INPUT_POST);
//$first_name = mysqli_real_escape_string($connect, $input["fname"]);
$fname = mysqli_real_escape_string($connect, $input["fname"]);
if($input["action"] === 'edit')
{
$query = "
UPDATE media
SET
fname = '".$fname."'
WHERE id = '".$input["id"]."'
";
mysqli_query($connect, $query);
//mysqli_set_charset($connect,"utf8");
}
if($input["action"] === 'delete')
{
$query = "
DELETE FROM media
WHERE id = '".$input["id"]."'
";
mysqli_query($connect, $query);
// mysqli_set_charset($connect,"utf8");
unlink("/home/playflu/media/files/".$name.".mp4");
}
echo json_encode($input);
?>