-
Notifications
You must be signed in to change notification settings - Fork 4
/
checkplag.php
53 lines (43 loc) · 1.04 KB
/
checkplag.php
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
47
48
49
50
51
52
53
<h1><div align="center">CHECK PLAG</div></h1>
<strong>MAKE A ZIP FOLDER OF ALL THE DOCUMENTS ON WHICH YOU WANT TO CHECK FOR PLAGIARISM AND UPLOAD IT BELOW.</strong><br><br>
<?php
if(isset($_FILES['file']['name']))
{
if(!empty($_FILES['file']['name']))
{
$location="uploads/";
$name=$_FILES['file']['name'];
$tmp_name=$_FILES['file']['tmp_name'];
$a=new SplFileInfo($name);
$extension=($a->getExtension());
if($extension!="zip")
{
echo "upload only zip files";
}
else
{
$files = glob("uploads/*");
foreach($files as $file)
{
echo $file;
if(is_file($file)){
unlink($file); }
}
move_uploaded_file($tmp_name,$location.$name);
include_once 'DB_FUNCTIONS.php';
$db=new DB_FUNCTIONS();
$db->delete_fingerprints();
$db->delete_result();
header("Location:checking.php");
}
}
else
{
echo "choose a file";
}
}
?>
<form action="checkplag.php" method="POST" enctype="multipart/form-data">
<input type="file" name="file"><br><br>
<input type="submit" name="submit">
</form>