Havning issues with file upload in php, below is the code

    <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" />
                <input type="submit" name="submit" value="Process information" />              

process.php below


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";
        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

Change this in your PHP code (line 6):

$uploaddir ='files/'.$_FILES['waec_scratch_card_file']['name'];


$uploaddir ='files/'.basename($_FILES['waec_scratch_card_file']['name']);