<?php
// We need to use sessions, so you should always start sessions using the below code.
session_start();
// If the user is not logged in redirect to the login page...
if (!isset($_SESSION['seniorpasteur'])) {
	header('Location: ../frontpage/index.html');
	exit;}
  ?>



<?php 
$target_dir = 'uploads';
$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
$uploadOk = 1;
$imageFileType = strtolower(pathinfo($target_file, PATHINFO_EXTENSION));
// check if it is  a  file 
if(isset($_POST["submit"])) {
    // save image to a variable for the check
    // how how how --which method to use?
    $check = $_FILES["fileToUpload"]["tmp_name"];
    move_uploaded_file($check, "$target_dir/$target_file");
    echo "file upload successfully";

    

}

?>
<div onClick="history.back()">Go Back</div>

<!-- if($check != false) {
        echo "File is uploaded successfully -" . $check["mime"] . ".";
        $uploadOk = 1;
        
    } else {
        echo "File is not upload";
        $uploadOk = 0;
    } -->