-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocess.php
More file actions
42 lines (33 loc) · 1.09 KB
/
Copy pathprocess.php
File metadata and controls
42 lines (33 loc) · 1.09 KB
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
<?php
require_once("includes/config.php");
$fileLink=$_POST['fileLink'];
$username=$_POST['username'];
$tool_id=$_POST['id'];
$marks=$_POST['totalMarks'];
if(isset($fileLink) && isset($username) && isset($tool_id) && isset($marks))
{
$query = $con->prepare("SELECT * FROM tools_assignment_filelink
WHERE username=:username AND tool_id=:tool_id" );
$query->bindValue(":username", $username);
$query->bindValue(":tool_id", $tool_id);
$query->execute();
if($query->rowCount() == 0) {
$bookmark=1;
$query = $con->prepare("INSERT INTO tools_assignment_filelink (username, tool_id, fileLink, totalMarks)
VALUES(:username, :tool_id, :fileLink, :totalMarks)");
$query->bindValue(":username", $username);
$query->bindValue(":tool_id", $tool_id);
$query->bindValue(":fileLink", $fileLink);
$query->bindValue(":totalMarks", $marks);
$query->execute();
if($query){
echo "File submitted Succesfully!";
}
}else{
echo "File already submitted!";
}
}
else {
echo "Data Missing!";
}
?>