<?php
	require("./includes/header.php");
	
	$jstoken = base64_encode(openssl_random_pseudo_bytes(12));
	$_SESSION['jstoken'] = $jstoken;
?>
<h2>Галерия със снимки</h2>
<form action="gallery_upload.php" method="POST" enctype="multipart/form-data">
<input type="file" name="fileToUpload" accept="image/gif,image/png,image/jpеg" /><br /><input type="submit" name="submit" value="Качи" />
</form>
<p>
<?php
	$images = glob("./uploads/*.{jpg,png,gif}", GLOB_BRACE);
	foreach($images as $image){
		echo "<a href='".$image."'>";
		echo "<img src='".$image."' width='100px' height='100px' /></a>";
	}
?>
</p>
<?php
	require("./includes/footer.php");
?>