upload.php 513 Bytes
<?php
session_start();
if($_SESSION['name']){
    if (isset($_FILES['upload'])) {
        $uploadDir = "./";
        $uploadedFile = $uploadDir . basename($_FILES['upload']['name']);
        if(move_uploaded_file($_FILES['upload']['tmp_name'], $uploadedFile)) {
            //chmod($uploadedFile, 0777);
            header('Location: workArea.php');
        } else {
            echo "Error: Unknown! <a href='workArea.php'>Click here to continue</a>";
        }
    }

}
else header('Location: index.php');	
?>