$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>
<?php

include 'includes/dbfunctions.php';
include "includes/resize-class.php";
$db = new DB_FUNCTIONS();
if (isset($_POST['submit'])) {
    $Title = $_POST['name'];
    $Description = $_POST['Description'];
    $Brand = $_POST['brand'];
    $Color = $_POST['color'];
    $Price = $_POST['price'];
    $sql = "INSERT INTO tbl_products SET Title = '" . $Title . "',Description = '" . $Description . "',Brand = '" . $Brand . "',Color = '" . $Color . "',Price = '" . $Price . "'";
    $result3 = mysql_query($sql);
    $last_ID = mysql_insert_id();
    for ($i = 0; $i < count($_POST['sizes']); $i++) {
        mysql_query("INSERT INTO tbl_productsizes SET ProductID = '" . $last_ID . "' , sizeID = '" . $_POST['sizes'][$i] . "'");
    }
    for ($i = 1; $i <= count($_FILES['photos']['name']); $i++) {
        $sepext = explode('.', $_FILES['photos']['name'][$i - 1]);
        $type = end($sepext);
        //$uniqueID = md5(uniqid());
        $newFileName = $sepext[0] . '.' . $type;
        $RnewFileName = $sepext[0] . '_R.' . $type;
        if (move_uploaded_file($_FILES['photos']['tmp_name'][$i - 1], "images/products/big/" . $newFileName)) {
            $resizeObj = new resize("images/products/big/" . $newFileName);
            $resizeObj->resizeImage(66, 91, 'crop');
            $resizeObj->saveImage("images/products/thumbs/" . $RnewFileName, 100);
            $resizeObj->resizeImage(202, 186, 'crop');
            $resizeObj->saveImage("images/products/medium/" . $newFileName, 100);
            mysql_query("INSERT INTO tbl_productphotos SET ProductID = '" . $last_ID . "' , photo = '" . $RnewFileName . "'");
        }
<h1><div align="center">CHECK PLAG</div></h1>
<?php 
require 'DB_FUNCTIONS.php';
$db = new DB_FUNCTIONS();
if (isset($_POST['email']) and !empty($_POST['email']) and isset($_POST['password']) and !empty($_POST['password'])) {
    $email = $_POST['email'];
    $password = $_POST['password'];
    $password_encrypted = md5($password);
    $a = $db->validUser($email, $password_encrypted);
    if ($a == true) {
        setcookie('email', $email, time() + 86400);
        //header("Location:checkplag.php");
    } else {
        echo "invalid email or password";
    }
} else {
    if (isset($_POST['email']) and isset($_POST['password'])) {
        echo "<strong>ALL FIELDS ARE REQUIRED</strong>";
    }
}
?>
<form action="index.php" method="POST">
	email<br>
	<input type="text" name="email">
	<br>
	PASSWORD<br>
	<input type="password" name="password">
	<br><br>
	<input type="submit" name="submit">
	<br>
	
 public function query_fingerprint()
 {
     unlink("result.zip");
     unlink("result.txt");
     $handle = fopen("result.txt", 'a');
     $db = new DB_FUNCTIONS();
     $files = scandir("uploads/ffcp/");
     $x = count($files) - 2;
     for ($i = 1; $i <= $x; $i++) {
         $a = $db->selectFingerPrint($i);
         $b = explode("\$", $a['fingerprint']);
         $count = $a['count'];
         for ($j = $i + 1; $j <= $x; $j++) {
             $n = 0;
             $c = $db->selectFingerPrint($j);
             $d = explode("\$", $c['fingerprint']);
             foreach ($d as $cd) {
                 foreach ($b as $ab) {
                     if ($ab == $cd) {
                         $n += 1;
                     }
                 }
             }
             if ($n >= 0) {
                 $percentage = $n / $count * 100;
                 $db->storeResult($a['filename'], $c['filename'], $percentage);
             }
         }
     }
     $result = $db->getResult();
     while ($r = mysqli_fetch_assoc($result)) {
         fwrite($handle, $r['file1'] . "\r\n" . $r['file2'] . "\r\n" . $r['percentage'] . "\r\n");
     }
     $db->delete_result();
     $db->delete_fingerprints();
     $zip = new ZipArchive();
     $zip->open('result.zip', ZipArchive::CREATE);
     $zip->addFile("result.txt");
     $zip->close();
     header("Location:download.php");
 }
<?php

include 'includes/dbfunctions.php';
$ProductID = $_GET['id'];
$db = new DB_FUNCTIONS();
$ProductMap = $db->getProductmap($ProductID);
//idher
$ProductDetails = $db->getProductDetails($ProductID);
//$getAllProductPhotos = $db->_getAllProductPhotos($ProductID);
//$getPSizes = $db->getAvailableSize($ProductID);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link href='http://fonts.googleapis.com/css?family=Cabin+Condensed' rel='stylesheet' type='text/css' />
<script 
			src="http://maps.googleapis.com/maps/api/js">
		</script>
<script type="text/javascript" src="js/jquery-1.10.1.min.js"></script>
<style type="text/css">
.button {
		padding: 5px 10px;
		display: inline;
		background: #777 url(images/button.png) repeat-x bottom;
		border: none;
		color: #fff;
		cursor: pointer;
		font-weight: bold;
		border-radius: 5px;
<?php

include 'includes/dbfunctions.php';
$ProductID = $_GET['id'];
$db = new DB_FUNCTIONS();
$ProductDetails = $db->getProductDetails($ProductID);
$getAllProductPhotos = $db->_getAllProductPhotos($ProductID);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link href='http://fonts.googleapis.com/css?family=Cabin+Condensed' rel='stylesheet' type='text/css' />
<script type="text/javascript" src="js/jquery-1.10.1.min.js"></script>
<style type="text/css">
.button {
		padding: 5px 10px;
		display: inline;
		background: #777 url(images/button.png) repeat-x bottom;
		border: none;
		color: #fff;
		cursor: pointer;
		font-weight: bold;
		border-radius: 5px;
		-moz-border-radius: 5px;
		-webkit-border-radius: 5px;
		text-shadow: 1px 1px #666;
		font-family:'Cabin Condensed', serif;
		}
	.button:hover {
<h1><div align="center">CHECK PLAG</div></h1>
<?php 
require 'DB_FUNCTIONS.php';
$db = new DB_FUNCTIONS();
if (isset($_POST['email']) and !empty($_POST['email']) and isset($_POST['password']) and !empty($_POST['password']) and isset($_POST['un']) and !empty($_POST['un']) and isset($_POST['confirmpassword']) and !empty($_POST['confirmpassword'])) {
    $email = $_POST['email'];
    $password = $_POST['password'];
    $un = $_POST['un'];
    $confirmpassword = $_POST['confirmpassword'];
    if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
        $emailerr = "Invalid email";
        echo $emailerr;
    } else {
        if (!($password == $confirmpassword)) {
            $passworderr = "Passwords Don't match";
            echo $passworderr;
        } else {
            $a = $db->userExists($email);
            if ($a == true) {
                echo "email aldready exists";
            } else {
                $db->storeUser($email, $password, $un);
            }
        }
    }
} else {
}
?>

<form action="register.php" method="POST">
	<strong> ALL FIELDS ARE MANDATORY </strong><br><br>