} else { $res .= "\n\t\t<br>\n\t\t<div id='error'>[-] String : [" . htmlspecialchars($encrypt_str) . "] \n\t\t<br>\n\t\t |\n\t\t<br>\n\t\t |--> Hash : [" . htmlspecialchars($hash) . "]\n\t\t<br>\n\t\t |--> Algorithm : [" . htmlspecialchars($encrypt_algo) . "] \n\t\t<br>\n\t\t |--> Status : [Exist In DB!]\n\t\t</div><br>"; } } //################################# End Insert String #################################// /*******************************************************************************************/ //################################# Start Insert File #################################// if (isset($_POST['add'])) { $encrypt_file = $_POST['encryptfile']; $encrypt_file = str_replace("../", "", $encrypt_file); $encrypt_algo = $_POST['algo']; } //open file; if (isset($encrypt_file) && isset($encrypt_algo) && is_file($encrypt_file)) { //split file; $encrypt_file = fsplit($encrypt_file); foreach ($encrypt_file as $files) { $fo = fopen($files, "r"); //check handler; if ($fo) { //read file line by line; while (($lines = fgets($fo)) !== false) { //convert string to hash; $lines = trim($lines); $hash = hashAlgorithm($encrypt_algo, $lines); //insert hash into created table; $select = "SELECT * FROM hash WHERE hashes=:hash"; $stmt = $connect->prepare($select); $stmt->bindParam(':hash', $hash); $stmt->execute(); $check = $stmt->fetchColumn();
<?php include './phpfslit.php'; $parts = fsplit("test.zip", 10000);