doctype html
doctype html
doctype html>
<html>
<head>
<title></title>
</head>
<body>
<form action="upload.php"method='POST'enctype="multipart/form-data">
<button type="submit"name="submit">UPLOAD</button>
</form>
</body>
</html>
2. <?php
if(isset($_post['submit'])){
$file=$_files['file'];
print_r($file);
$fileName=$_files['file']['name'];
$fileTmpname=$_files['file']['tmp_name'];
$fileSize=$_files['file']['size'];
$fileError=$_files['file']['error'];
$fileType=$_files['file']['type'];
$fileExt=explode('.',$fileName);
$fileActualExt=strtolower(end($fileExt));
$allowed=array('jpg','jpeg','png','pdf');
if(in_array($fileActualExt,$allowed)){
if($fileError===0) {
if($fileSize<1000000){
$fileNameNew=uniqid('',true).".".$fileActualExt;
$fileDestination='uploads/'.$fileNameNew;
move_uploaded_file($fileTmpname,$fileDestination);
header("location:index.php?uploadsuccess");
}else{
}else{
}else{