在$ autoreply下将链接或可下载内容放在php中?

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了在$ autoreply下将链接或可下载内容放在php中?相关的知识,希望对你有一定的参考价值。

是否有可能在我的php中将$ link或autoreply下的链接或任何可下载内容放入(点击这里)?

我几乎没有在网上找到任何答案,我认为我仍然缺乏对PHP编码的理解。

<?php

/* SETTING VARIABLES */

/* FORMFIELD 1 */
$name = $_POST['name'];
$lastname = $_POST['lastname'];
$nickname = $_POST['nickname'];
$age = $_POST['age'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$skype = $_POST['skype'];

/* FORMFIELD 2 */
$membership = implode(',', $_POST['membership']);
$memberdetail = $_POST['memberdetail'];

/* RESPONSE TO Eng2Skype's email */

$autoreply="Thank you for registering with English2Skype™ 

Please click HERE to download our manual and application forms 

 English2Skype™ team";
$subject="Thank you for your submission! - English2Skype";

mail($email, $subject, $autoreply);

/* INFORMATION TO BE EMAILED */

$formcontent = "Name: $name 
 Lastname: $lastname 
 Nickname: $nickname 
 Age: $age 
 Phone: $phone 
 Email: $email 
 Skype: $skype 
 Membership: $membership 
 Member Detail: $memberdetail";

$recipient = "englishtoskype@gmail.com";
$subject = "Eng2Skype Online Register";
$mailheader = "From: $email 
";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");

/* RESPONSE TO Eng2Skype's email */

echo '<img src="../images/subpages/eng2skype.png">';
echo "<br>";
echo "<br>";
echo "Thank you for registering with English2Skype program. Please check your email for downloadable manual and application forms.";

echo "<br>";
echo "<br>";
echo "<a href='../index.php' style='text-decoration:none; color:#df2590;'> Return Home</a>";

echo "<br>";
echo "<br>";
echo "Love us, Follow us at";
echo '<img src="../images/subpages/eng2skype-poster.png" width="200" height="200" />';
?>
答案

你可以写一个html电子邮件。您需要设置标题,只需添加一个链接到HERE。

$mailheader = 'MIME-Version: 1.0'."
";
$mailheader .= 'Content-type: text/html; charset=iso-8859-1'."
";
$mailheader .= 'From: '.$email." 
";


$autoreply="Thank you for registering with English2Skype™ 

Please click <a href='http://your.download.link'>HERE</a> to download our manual and application forms 

 English2Skype™ team";

https://secure.php.net/manual/en/function.mail.php

以上是关于在$ autoreply下将链接或可下载内容放在php中?的主要内容,如果未能解决你的问题,请参考以下文章

从 JavaScript 创建一个可下载的附件?

使用 R 从网页中抓取可下载文件的链接地址?

检测链接是不是为可下载文件

如何在CodeIgniter中将上载的文件(PDF,DOC等)显示为可下载的链接

如何通过可下载的链接将文本保存为 .txt 文件?

iOS上的应用内购买可下载内容<6