<?php
$Email = @trim(stripslashes($_POST['Email']));
$Name = $_POST['Name'];
$Email = $_POST['Email'];
$Number= $_POST['Number'];
$Subject= $_POST['Subject'];
$Message= $_POST['Message'];
$formcontent="
Name: $Name \n
Email: $Email \n
Number: $Number \n
Subject: $Subject\n
Message: $Message";
$recipient = "info@domain.com";
$mailheader = "From: $Name \r\n";
mail($recipient, $Subject, $formcontent, $mailheader) or die("Error!");
echo "<h4 align= center><b>Thank You $Name!</b></h4>";
?>
对于这个PHP代码,结果显示为谢谢你名字!“;?&gt;离线而不是在服务器端。为什么它没有显示人名?
答案 0 :(得分:2)
试试这个:\
echo "<h4 align= center><b>Thank You ".$Name."!</b></h4>";
答案 1 :(得分:0)
试试这个,
echo "<h4 align= center><b>Thank You '".$Name."'!</b></h4>";