/    Sign up×
Community /Pin to ProfileBookmark

How can I make this support 3 attachments?

This is a snippet of a Free formail script. The full instructions of which can be found here [url]http://www.dtheatre.com/scripts/formmail_doc.php[/url]

Does anyone know how this can be made to support 3 attachments instead of 1?

I’ve tride duplicating that bit of code and sticking a 2 on the end of each ‘attachment’ and obviously changing the ‘browse’ upload button the ‘attachment2’ from ‘attachment’

Elsewhere in the full script it supports having 2 or more files uploaded to a directory, so I’m hoping its not that difficult to amend.

I’d be most grateful.

// check for an attachment if there is a file upload it
if ($attachment_name) {
if ($attachment_size > 0) {
if (!$attachment_type) $attachment_type = “application/unknown”;
$content .= “Attached File: “.$attachment_name.”n”;
$fp = fopen($attachment, “r”);
$attachment_chunk = fread($fp, filesize($attachment));
$attachment_chunk = base64_encode($attachment_chunk);
$attachment_chunk = chunk_split($attachment_chunk);
}
}

Cheers

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @Yanhead 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,
)...