<?php require_once("../../classes/DBConnection.php"); $DB = new DBConnection();
$path_to_folder = trim($_POST['path_to_folder']); $n = 0; $p = 0;

echo "<span style='font-size:24px'>RENAMING IN {$path_to_folder}</span><br />";
$picturenames = scandir(trim($_POST['path_to_folder']));
foreach($picturenames as $picturename){
	$isDup = true;
	$n++;
	if($picturename!="." && $picturename!=".."){
		//rename each one
		rename($path_to_folder.'/'.$picturename, $path_to_folder.'/'.'~~~'.substr($picturename, 3));
	}
}
echo "<br />ENDED<hr />".($n-2)." file(s) processed.";