How do I edit the following script to filter file types and limit them?
PHP Code:
<?php
    $settings
['imEmailForm_17_5'] = array(
        
"owner_email_from" => "eMail Address",
        
"owner_email_to" => "admin@potternet.net",
        
"customer_email_from" => "do-not-reply@potternet.net",
        
"customer_email_to" => "eMail Address",
        
"owner_message" => "",
        
"customer_message" => "We thank you for your enquiry and will get back to you within 48 hours to begin the process of verifying the information you have sent to us and begin creating the template for your site. 

Kind Regards,
PotterNet Site Admin Team"
,
        
"owner_subject" => "Advert Request",
        
"customer_subject" => "Thank you for yourAdvert Request",
        
"owner_csv" => True,
        
"customer_csv" => True,
        
"confirmation_page" => "../advertising-home.html"
    
);

    if(
substr(basename($_SERVER['PHP_SELF']), 011) == "imEmailForm") {
        include 
"../res/x5engine.php";

        
$answers = array(
        );

        
$form_data = array(
            array(
'label' => 'Accept Terms & Conditions?''value' => $_POST['imObjectForm_5_1']),
            array(
'label' => 'Name''value' => $_POST['imObjectForm_5_2']),
            array(
'label' => 'eMail Address''value' => $_POST['imObjectForm_5_3']),
            array(
'label' => 'Website URL''value' => $_POST['imObjectForm_5_4']),
            array(
'label' => 'Company Name''value' => $_POST['imObjectForm_5_5']),
            array(
'label' => 'Do you require text in your advert?''value' => $_POST['imObjectForm_5_7']),
            array(
'label' => 'Do you want us to design your advert for you?''value' => $_POST['imObjectForm_5_8'])
        );

        
$files_data = array(
            array(
'label' => 'Company Logo''value' => $_FILES['imObjectForm_5_6']),
            array(
'label' => 'Advert Images''value' => $_FILES['imObjectForm_5_9'])
        );

        if(@
$_POST['action'] != "check_answer") {
            if(!isset(
$_POST['imJsCheck']) || $_POST['imJsCheck'] != "jsactive")
                die(
imPrintJsError());
            if (isset(
$_POST['imCpt']) && !isset($_POST['imCptHdn']))
                die(
imPrintJsError());
            if(isset(
$_POST['imSpProt']) && $_POST['imSpProt'] != "")
                die(
imPrintJsError());
            
$email = new imSendEmail();
            
$email->sendFormEmail($settings['imEmailForm_17_5'], $form_data$files_data);
            @
header('Location: ' $settings['imEmailForm_17_5']['confirmation_page']);
        } else {
            if(@
$_POST['id'] == "" || @$_POST['answer'] == "" || strtolower(trim($answers[@$_POST['id']])) != strtolower(trim(@$_POST['answer'])))
                echo 
"0";
            else
                echo 
"1";
        }
    }

// End of file
I want to limit the file types to only certain ones but cant figure out where to add the code and what to put in (bearing in mind that my PHP knowledge is non-existent). Please help! :-)