-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadd-label.php
More file actions
36 lines (30 loc) · 990 Bytes
/
Copy pathadd-label.php
File metadata and controls
36 lines (30 loc) · 990 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
<?php
//print_r($_POST);
include "conn.php";
$video_id = $mysqli->escape_string($_POST["video_id"]);
$user_id = $mysqli->escape_string($_POST["user_id"]);
$tm = $mysqli->escape_string($_POST["tm"]);
$type = $mysqli->escape_string($_POST["type"]);
$tool = $mysqli->escape_string($_POST["tool"]);
$comment = $mysqli->escape_string($_POST["comment"]);
$thumbnail = $mysqli->escape_string($_POST["filepath"]);
//$url = "label.php?vid=$video_id&uid=$user_id&tm=$tm";
$url = "label.php?vid=$video_id&tm=$tm";
$success = true;
if (!$mysqli->query("INSERT INTO labels(video_id,user_id,tm,type,tool,comment,thumbnail) " .
"VALUES('$video_id', '$user_id', '$tm', '$type', '$tool', '$comment', '$thumbnail')"))
$success = false;
if ($mysqli->affected_rows != 1)
$success = false;
$json = array(
"id"=>$mysqli->insert_id,
"thumbnail"=>$thumbnail,
"tm"=>$tm,
"type"=>$type,
"tool"=>$tool,
"comment"=>$comment,
"url"=>$url,
"success"=>$success
);
echo json_encode($json);
?>