Javascript 使用php和mysql将发票发送到电子邮件
我的英语语法不是很好,但我希望有人能理解我 我想使用输入创建并发送发票。 类似于带有电子邮件密钥确认的注册页面 例如 我有invoiceinformation.phpJavascript 使用php和mysql将发票发送到电子邮件,javascript,php,html,mysql,Javascript,Php,Html,Mysql,我的英语语法不是很好,但我希望有人能理解我 我想使用输入创建并发送发票。 类似于带有电子邮件密钥确认的注册页面 例如 我有invoiceinformation.php <script><?php session_start(); $_SESSION['invoice'] = $invoice; $_SESSION['name'] = $name; $_SESSION['address'] = $address; $_SESSION['city'] = $city; $_SES
<script><?php
session_start();
$_SESSION['invoice'] = $invoice;
$_SESSION['name'] = $name;
$_SESSION['address'] = $address;
$_SESSION['city'] = $city;
$_SESSION['state'] = $state;
$_SESSION['zip'] = $zip;
?></script>
<html>
<h3 align="center">Invoice Information</H3>
<form align="center" method="get" action="**Auto create by invoice value**">
<input type="text" name="invoice" value="" placeholder="Invoice#"><br>
<input type="text" name="name" value="" placeholder="Buyer Name"><br>
<input type="text" name="address" value="" placeholder="Address"><br>
<input type="text" name="city" value="" placeholder="City"><br>
<input type="text" name="state" value="" placeholder="State"><br>
<input type="text" name="zip" value="" placeholder="Zip Code"><br>
<input type="submit">
</form>
</html>
在“按发票值自动创建”中,我想把这个
<?php
session_start();
$invoice = $_GET['invoice'];
$name = $_GET['name'];
$address = $_GET['address'];
$city = $_GET['city'];
$state = $_GET['state'];
$zip = $_GET['zip'];
?>
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<meta name="MobileOptimized" content="width" />
<meta name="HandheldFriendly" content="true" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<title><?php echo $invoice; ?></title>
</head>
<body>
<small><font size="2" color="#999999" face="verdana,
sans-serif"><b><span class=""> sent this invoice to
<br><?php echo $name; ?><br>
Your registered name is included to show this invoice from Company</b></font>
<span>Your address is : <?php echo $address; ?>
<span>Your City is : <?php echo $city; ?>
<span>Your Zip Code is : <?php echo $zip; ?>
<span>Your State is : <?php echo $state; ?>
</body>
</html>
然后,我想用自动创建发票值的源代码创建.php
之后,我想发送一封电子邮件,但我需要一封电子邮件,如下所示:
letter.php
<h3>Thanks for using company ! <br>Here's your invoice.<br></h3>
<a href="https://example.com/<?php echo $invoice; ?>.php" >View Invoice</a>
或者更容易。。。如果我能,当然 首先,我不知道什么是按发票价值自动创建的。 但我可以给你提供一些信息 假设您有3个页面&您没有数据库: invoiceinformation.php AutoCreate.php letter.php 哪个 invoiceinformation.php使用表单收集表单用户的值,并将所有这些值发送到AutoCreate.php AutoCreate.php显示来自用户输入的所有这些值,并确认用户这些输入是否正确,如果有不正确的输入,它将重定向到invoiceinformation.php页面,用户重新输入这些不正确的输入 php用于检索信息并通知用户您将向其各自的电子邮件地址发送电子邮件。 这很简单,您不需要在invoiceinformation.php中设置这些会话,而是在AutoCreate.php中设置这些会话
$to = $_SESSION['email'];
$subject = "Invoice";
$txt = "Hello world!"; //this is the body text u can put ur invoice here
$headers = "From: webmaster@example.com" . "\r\n" . // this is your site email & user email (CC)
"CC: somebodyelse@example.com";
mail($to,$subject,$txt,$headers);
action=**按发票值自动创建**-action值应该是一个文件名。我理解,但我想在提交输入后在public_html中创建一个类似.php的文件,这样我就可以在电子邮件中发送一个带有此链接的按钮,.php类似: