Havning issues with file upload in php, below is the code
<html>
<head>
<title>margeducation</title>
</head>
<body>
<p> Niggas Please upload your files in pdf or jpg format, size less than 500kbytes, capishe</p>
<form enctype="multipart/form-data" action="processfile.php" method="post" >
<p>REQUIRED DOCUMENTS:(Please Select all documents that were recieved for this student's application):<br/></p>
<input type="checkbox" name="waec_scratch_card_chk" value="waec_scratch_card" />WAEC SCRATCH CARD
<input type="hidden" name="MAX_FILE_SIZE" value="500000" />
<input type="file" name="waec_scratch_card_file" />
<br/>
<input type="submit" name="submit" value="Process information" />
</form>
</body>
</html>
process.php below
<?php
if($_FILES['waec_scratch_card_file']['type'] == "image/jpeg" || $_FILES['waec_scratch_card_file']['type'] == "application/pdf")
{
$uploaddir ='files';
if (move_uploaded_file($_FILES['waec_scratch_card_file']['tmp_name'], $uploaddir))
{
echo "success";
}
else
{
echo "did not get in";
}
}
else echo 'wrong file type nigga';
?>
Instead of the file to be uploaded into the 'files' folder in the $uploaddir it is being uploaded into an extentionless file with the name files
Please can anyone help rectify this problem