我有一个问题。我需要从dropdows收集信息并发送包含该信息的电子邮件。我该怎么做?我想在他们选择他们想要生成邮件的内容并发送它并将这封邮件和他的日期写在数据库表中时。
<html>
<body>
<form>
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "toner_orders";
$conn = new mysqli($servername, $username, $password, $dbname);
$sql = "SELECT name FROM printers";
$sql2 = "SELECT pieces FROM toners";
$result = mysqli_query($conn, $sql);
$result2 = mysqli_query($conn, $sql2);
echo "<select>";
while ($row = mysqli_fetch_array($result)) {
echo "<option value='" . $row['name'] ."'>" . $row['name'] ." </option>";
}
echo "</select>";
echo "<select>";
while ($row = mysqli_fetch_array($result2)) {
echo "<option value='" . $row['peices'] ."'>" . $row['pieces'] ." </option>";
}
echo "</select>";
?>
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "toner_orders";
$conn = new mysqli($servername, $username, $password, $dbname);
$sql = "SELECT name FROM printers";
$sql2 = "SELECT pieces FROM toners";
$result = mysqli_query($conn, $sql);
$result2 = mysqli_query($conn, $sql2);
echo "<select>";
while ($row = mysqli_fetch_array($result)) {
echo "<option value='" . $row['name'] ."'>" . $row['name'] ."</option>";
}
echo "</select>";
echo "<select>";
while ($row = mysqli_fetch_array($result2)) {
echo "<option value='" . $row['peices'] ."'>" . $row['pieces'] ." </option>";
}
echo "</select>";
?>
<br><br>
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "toner_orders";
$conn = new mysqli($servername, $username, $password, $dbname);
$sql = "SELECT name FROM printers";
$sql2 = "SELECT pieces FROM toners";
$result = mysqli_query($conn, $sql);
$result2 = mysqli_query($conn, $sql2);
echo "<select>";
while ($row = mysqli_fetch_array($result)) {
echo "<option value='" . $row['name'] ."'>" . $row['name'] ." </option>";
}
echo "</select>";
echo "<select>";
while ($row = mysqli_fetch_array($result2)) {
echo "<option value='" . $row['peices'] ."'>" . $row['pieces'] ." </option>";
}
echo "</select>";
?>
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "toner_orders";
$conn = new mysqli($servername, $username, $password, $dbname);
$sql = "SELECT name FROM printers";
$sql2 = "SELECT pieces FROM toners";
$result = mysqli_query($conn, $sql);
$result2 = mysqli_query($conn, $sql2);
echo "<select>";
while ($row = mysqli_fetch_array($result)) {
echo "<option value='" . $row['name'] ."'>" . $row['name'] ."</option>";
}
echo "</select>";
echo "<select>";
while ($row = mysqli_fetch_array($result2)) {
echo "<option value='" . $row['peices'] ."'>" . $row['pieces'] ." </option>";
}
echo "</select>";
?>
<br><br>
<input type="submit" value="Submit">
</form>
</body>
</html>