php - 使表格中的电子邮件地址可点击,打开发送电子邮件
问题描述
我的表是从 php 中的 phpmyadmin 数据库填充的:
while($row2 = mysqli_fetch_array($result2))
{
$dataRow2 = $dataRow2."
<tr>
<th>Event Name</th>
<th>$row2[1]</th>
<th>Location</th>
<th>$row2[2]</th>
<th>Description</th>
<th>$row2[3]</th>
<th>Date</th>
<th>$row2[4]</th>
<th>Cost</th>
<th>$row2[5]</th>
<th>Email</th>
<th>$row2[6]</th>
</tr>";
}
并且在 HTML 中是这样的:
<table>
<?php echo $dataRow2;?>
</table>
我想让最后一个(电子邮件地址)可点击,打开一个 sendto 让用户通过电子邮件发送地址。这是如何实现的?
解决方案
假设电子邮件是$row2[6]
,您希望将其替换为
<th><a href=\"mailto:$row2[6]\">$row2[6]</a></th>
这会将其更改为电子邮件地址在表格中仍然可见的链接。
推荐阅读
- python - Python内存块
- android - 如何制作验证微调器适配器?
- c# - 用鼠标移动物体?
- android - ViewPager 和 recyclerview 混乱
- c - 带有管道的非终止 C 程序
- asp.net - 如何在 IIS 中为 asp.net 核心应用程序创建一个具有所有必要设置的新网站?
- arrays - 计算二维数组中从 arr[0,0] 到 arr[N,M] 的路径数,其中只能向右和向下移动
- keras - 使用 opencv 将 RGB 转为 GREY 移除 1 个通道
- mongodb - Robo 3T MongoDB 不是主要的
- java - 在可运行 jar 中包含 src/main/resources 中的文件