有人可以为此推荐最佳解决方案吗?
我在wordpress网站上添加了Reveal弹出窗口。在我的网站上有一个包含6个PDF文件的下载页面。我将popup与它集成,当任何人点击任何PDF文件弹出窗口的下载按钮时会自动出现。弹出窗口包含一个包含名称,电子邮件地址,地址字段的订阅表单
弹出,表格一切正常。我只需要 - 相应的文件(取决于点击的链接)在表单提交后自动开始下载。
<div style="width:100%;">
<div style="width:30%; float:left;">
<h6>Top tips for Make Vs. Buy decisions</h6>
<p>Make Vs. Buy (MvB) is an integral part of any purchasing function. We have to give information and help make decisions over the best strategic fit of our manufacturing operations whether in-house or in the supply chain. Here are some pointers to help you get it right.</p>
<a href="pdffile1.pdf" class="big-link" data-reveal-id="myModal"><img src="http://inxpresssheffield.co.uk/wp-content/uploads/2013/07/document.png" alt="" /></a>
</div>
<div style="width:30%; float:left;">
<h6>Top tips for Make Vs. Buy decisions</h6>
<p>Make Vs. Buy (MvB) is an integral part of any purchasing function. We have to give information and help make decisions over the best strategic fit of our manufacturing operations whether in-house or in the supply chain. Here are some pointers to help you get it right.</p>
<a href="pdffile2.pdf" class="big-link" data-reveal-id="myModal"><img src="http://inxpresssheffield.co.uk/wp-content/uploads/2013/07/document.png" alt="" /></a>
</div>
<div style="width:30%; float:right;">
<h6>Top tips for Make Vs. Buy decisions</h6>
<p>Make Vs. Buy (MvB) is an integral part of any purchasing function. We have to give information and help make decisions over the best strategic fit of our manufacturing operations whether in-house or in the supply chain. Here are some pointers to help you get it right.</p>
<a href="pdffile3.pdf" class="big-link" data-reveal-id="myModal"><img src="http://inxpresssheffield.co.uk/wp-content/uploads/2013/07/document.png" alt="" /></a>
</div>
</div>
<div id="myModal" class="reveal-modal">
<h1>Thanks for clicking</h1><br />
<p class="popup_text">In order to receive access to your document please complete the details below.</p>
<p class="popup_text">From time to time we may send you information that we think will be relevant to your interests, however you can unsubscribe at any time by emailing UNSUBSCRIBE to <a href="mailto:enquiriesuk122@inxpress.com" style="text-decoration:none; color:#000; font-weight:bold;">enquiriesuk122@inxpress.com</a></p>
<form method="post" action="http://inxpresssheffield.co.uk/popup/submit.php" style="display:block !important;">
<span class="popup_label">Name:</span><span style="margin-left:76px;"><input type="text" name="name" class="popup_input" /></span><br />
<span class="popup_label">Company Name:</span><span style="margin-left:10px;"><input type="text" name="company" class="popup_input" /></span><br />
<span class="popup_label">Email Address:</span><span style="margin-left:20px;"><input type="text" name="email" class="popup_input" /></span><br /><br />
<input type="submit" name="submit" value="Submit" class="submit" />
</form>
<a class="close-reveal-modal">×</a>
</div>
<?php
$to = "gamarsh@yahoo.co.uk";
$subject = "Downloadable Documents";
$message = "Hey, Someone Sent you a Contact Message via Download Section of your Website.Details below-Name: $_POST[name]Company Name: $_POST[company] Email Address: $_POST[email] IP: ".$_SERVER['REMOTE_ADDR']."";
$from = "info@inxpresssheffield.co.uk";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
header("location:http://inxpresssheffield.co.uk/downloads/");
?>
答案 0 :(得分:0)
也许您可以添加类似<input type="hidden" name="thefile"/>
的内容,并在用户点击链接时使用JavaScript修改此输入的值?
您可以使用PHP中的$_POST["thefile"]
获取值,以便将其添加到重定向(header())。
请注意,如果主机名稍后更改,您可以使用相对链接而不是绝对链接。