$message .= "
<html>
<head>
<title>Copy of your form submission</title>
</head>
<body>
<table>
<tr>
<td>
"<img src="images/assets/thank_you.png" alt="Thank You" />"
</td>
</tr>
</table>
</div>
</html>
";
如果我写
$ message。=上面的相同图片链接;
它正在工作。但是当我将图像标签写入上面的html时,那就不行了。任何人都可以帮忙吗?
不要在"
标签周围使用引号img
。也可以在双引号'
中使用单引号"
。如下所示:
$message .= "
<html>
<head>
<title>Copy of your form submission</title>
</head>
<body>
<table>
<tr>
<td>
<img src='images/assets/thank_you.png' alt = 'Thank You' />
</td>
</tr>
</table>
</div>
</html>";
你可以试试
$message .= "
<html>
<head>
<title>Copy of your form submission</title>
</head>
<body>
<table>
<tr>
<td>
<img src='images/assets/thank_you.png' alt='Thank You'/>
</td>
</tr>
</table>
</div>
</html>
";
当使用图像链接与PHP
$message .= "
<html>
<head>
<title>Copy of your form submission</title>
</head>
<body>
<table>
<tr>
<td>
<img src=".$imagelink." alt='Thank You'/>
</td>
</tr>
</table>
</div>
</html>
";
我从你的代码中理解的是字符串中的concat可能有3种可能的方法来纠正它
第一:
$message .= "
<html>
<head>
<title>Copy of your form submission</title>
</head>
<body>
<table>
<tr>
<td>
<img src='images/assets/thank_you.png' alt='Thank You' />
</td>
</tr>
</table>
</div>
</html>
";
第二:
$message .= "
<html>
<head>
<title>Copy of your form submission</title>
</head>
<body>
<table>
<tr>
<td>";
$message .='<img src="images/assets/thank_you.png" alt="Thank You" />';
$message .="</td>
</tr>
</table>
</div>
</html>
";
第三:
$message .= "
<html>
<head>
<title>Copy of your form submission</title>
</head>
<body>
<table>
<tr>
<td>
<img src=\"images/assets/thank_you.png\" alt=\"Thank You\" />
</td>
</tr>
</table>
</div>
</html>
";