/    Sign up×
Community /Pin to ProfileBookmark

php mailier script

How do I edit the following script to filter file types and limit them?

[code=php]<?php
$settings[‘imEmailForm_17_5’] = array(
“owner_email_from” => “eMail Address”,
“owner_email_to” => “[email protected]”,
“customer_email_from” => “[email protected]”,
“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’]), 0, 11) == “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[/code]

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! 🙂

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @PotterNet spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.4,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...