php - 创建 "email this page"到某人链接的快速简单方法?

标签 php html

有没有一种快速创建链接的方法,点击该链接后,用户可以通过 mailto 发送他们所在页面的链接?

最佳答案

要发送您所在页面的链接,请尝试使用以下代码:

<a HREF="mailto:?subject=look at this website&body=Hi,I found this website
and thought you might like it <?php
$url="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
echo $url;
?>">Tell a friend!</a>

php 将获取您当前所在页面的 url。

关于php - 创建 "email this page"到某人链接的快速简单方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10581649/

相关文章:

javascript - 在html5中使用filewriter api写两次会导致错误

javascript - html 日期输入中的最大属性在 Firefox 中不起作用

jquery - 在 jQuery 中创建 div 作为子容器

php - 如何将条件插入到 SQL SELECT 中?

javascript - 将 ajax 值传递到 Laravel Controller

php - $request 中的已上传文件

javascript - 如何在不使用打开窗口的情况下关闭选项卡

html - 如何防止某些背景图像缓存

javascript - 如何在 window.location 更改时保持页面位置?

php - 一旦表单对象已经创建,如何在特定位置添加 zend 表单元素?