-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadd.php
More file actions
46 lines (28 loc) · 796 Bytes
/
add.php
File metadata and controls
46 lines (28 loc) · 796 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
39
40
41
42
43
44
45
46
<?php
//add.php
include('database_connection.php');
$response = file_get_contents('http://localhost:8080/userId');
$JSONO=json_decode($response);
$reb= $JSONO[0]->userId;
$response1 = file_get_contents('http://localhost:8080/repoId');
$JSON1=json_decode($response1);
//$reb1= $JSON1[0]->pid;
// for userId
$res=(int)$reb;
// for repoId
//$res1=(int)$reb1;
$name => $_POST['name'],
$pid => $_POST['pid'],
$type => $_POST['type'],
$fileC => $_POST['fileC']
$RID1=$_POST['pid'];
echo $RID1;
$query = "
INSERT INTO fileStructure (name, pid,type,fileC,userId,repoId) VALUES ('$name','$pid','$type', '$fileC','$res','$RID1')
";
$statement = $connect->prepare($query);
if($statement->execute($data))
{
echo 'Category Added';
}
?>