-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaddLike.php
More file actions
34 lines (19 loc) · 712 Bytes
/
addLike.php
File metadata and controls
34 lines (19 loc) · 712 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
<?php
header("Access-Control-Allow-Origin: *");
require_once 'config/appsConfig.php';
require_once 'middleware/Xss.php';
require_once 'middleware/Csrf.php';
$apps = new appsConfig();
appsConfig::loadLibaryClass();
$d = new DBContext();
$comment = $_GET['commentid'];
$questionsid = $_GET['qusid'];
$data = ['commentid'=>$comment,'questionsid'=>$questionsid,'dates'=>date('y-m-d')];
if($d->addData('likes',$data)){
$questionsid = rtrim($questionsid,",");
$sql = "select * from likes where questionsid =".$questionsid." and commentid =".$comment;
echo $d->dataCount($sql);
}else{
print_r($d->Error);
}
?>