генерация PDF — отправка PHP по почте в формате PDF или как есть

Я новичок в PHP и сумел создать форму, которая отображает php созданную веб-страницу при отправке.

Теперь я хочу отправить по электронной почте именно то, что появляется на странице, сгенерированной php, кому-то (в данном случае это администратор). В идеале в формате PDF.

Так:
1. Пользователь заполняет форму
2. Клики Отправить
3. Форма обрабатывается и отправляется по электронной почте в виде файла PDF

Вопрос в том, как мне это сделать?

HTML:

<form action="somefile.php" method="POST" name="form1" id="form1" >
<p>Hochtief (UK) Construction Ltd</p>
<p>IT/Themis Account Request </p>
<p>&nbsp;</p>
<p>Please choose one of the following:  </p>
<table width="400">
<td><label>
<input type="radio" name="radio1" value="Set up" required id="AddAmendDelete_0">
Set up</label></td>

<td><label>
<input type="radio" name="radio1" value="Amend" id="AddAmendDelete_1">
Amend</label></td>

<td><label>
<input type="radio" name="radio1" value="Delete" id="AddAmendDelete_2">
Delete</label></td>

</table>
<p><br>
</p>
<p>Please choose one of the following:  </p>
<table width="600">
<td><label>
<input type="radio" name="UserType" value="Direct Employee" required id="UserType_0">
Direct Employee</label></td>

<td><label>
<input type="radio" name="UserType" value="Subcontractor" id="UserType_1">
Subcontractor</label></td>

<td><label>
<input type="radio" name="UserType" value="Freelance Individual" id="UserType_2">
Freelance Individual</label></td>

</table>
<p>&nbsp;</p>
<p>
<label for="Title">Title:</label>
<input name="Title" type="text" required id="Title">
</p>
<p>
<label for="fname">Forename:</label>
<input name="fname" type="text" required id="fname">
</p>
<p>
<label for="sname">Surname:</label>
<input name="sname" type="text" required id="sname">
</p>
<p>
<label for="location">Location (Head Office/Project Location):</label>
<input name="location" type="text" required id="location">
</p>
<p>
<label for="phone">Phone Number:</label>
<input type="phone" name="number" id="phone">
</p>

<p>
<label for="job">Job Title:</label>
<input name="job" type="text" required id="job">
</p>
<p>
<label for="sdate">Start Date:</label>
<input name="sdate" type="date" required id="sdate">
</p>
<p>
<label for="enddate">Anticipated End Date:</label>
<input type="date" name="enddate" id="enddate">
(Must be completed for Subcontractor/Freelance)</p>
<p>
<label for="line">Line Manager (Direct Employees)<br>
Reporting Manager (Subcontractor/Freelance)
:</label>
<input name="line" type="text" required id="line">
</p>
<p>
<label for="email">New User Email:</label>
<input name="email" type="email" required id="email">
</p>
<p>
<label for="leave">Leave Allocation (HR to complete for Direct Employees only):</label>
<input type="number" name="leave" id="leave">
</p>

<input type="submit">
</form>

</body>
</html>

PHP:

<p>Company</p>
<p>Account Request </p>

<br>
<br>
A
<strong><?php

$selected_radio = $_POST['radio1'];
print $selected_radio; ?></strong>

request has be made for a

<strong><?php

$selected_radio = $_POST['UserType'];
print $selected_radio; ?></strong>:
<br>
<br>
Name: <strong><?php echo $_POST["Title"];  ?>

<?php echo $_POST["fname"];  ?>

<?php echo $_POST["sname"];   ?></strong>

<br>

Location: <strong><?php echo $_POST["location"]; ?></strong>
<br>
Phone Number: <strong><?php echo $_POST["phone"]; ?></strong>
<br>
Job Title: <strong><?php echo $_POST["job"]; ?></strong>
<br>
Start Date: <strong><?php echo $_POST["sdate"]; ?></strong>
<br>
Anticipated End Date: <strong><?php echo $_POST["enddate"]; ?></strong>
<br>
Line Manager: <strong><?php echo $_POST["line"]; ?></strong>
<br>
Email Address: <strong><?php echo $_POST["email"]; ?></strong>
<br>
Leave Allocation: <strong><?php echo $_POST["leave"]; ?></strong>

0

Решение

Задача ещё не решена.

Другие решения

Других решений пока нет …

По вопросам рекламы ammmcru@yandex.ru
Adblock
detector