Answer the question
In order to leave comments, you need to log in
How to transfer files from the form to send to the mail?
Hi all.
There is a form in which files are uploaded
<div class="input-form-wrapper">
<span>*****</span>
<div class="file-upload" data-text="Выберите файл">
<input type="file" name="photo_file" >
</div>
</div>
<div class="input-form-wrapper">
<span>*****</span>
<div class="file-upload" data-text="Выберите файл">
<input type="file" name="photo_file" >
</div>
</div>
<div class="input-form-wrapper">
<span>*****</span>
<div class="file-upload" data-text="Выберите файл">
<input type="file" name="photo_file" >
</div>
</div>
$mail->setFrom('[email protected]', 'First Last');
$mail->addAddress('[email protected]', 'John Doe');
$mail->Subject = 'PHPMailer file sender';
$mail->msgHTML("My message body");
// Attach uploaded files
$mail->addAttachment($filename1);
$mail->addAttachment($filename2);
$r = $mail->send();
Answer the question
In order to leave comments, you need to log in
For such a task, the Fowler pattern Class Table Inheritance is well suited , the task of which is to make some kind of inheritance in database tables.
A certain entity Client is created, and the entities of a Legal Person and an Individual are inherited from it, they are connected 1 to 1, that is, there is either one individual or one legal entity per 1 client, this is resolved by some kind of mapping through a conditional field type
in the client table, you just need to observe the moment so that the id of an individual does not intersect with a legal entity, for example, using uuid or creating an id in any other way, for example, through auto-increment of the client table.
If you implement the backend in PHP, then ORM Doctrine can work with the following structure out of the box: Documentation.
Good afternoon.
Everything is described in the official documentation .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question