谢谢$ name显示,因为它没有显示人名

时间:2015-04-09 05:59:21

标签: php html5

 <?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;离线而不是在服务器端。为什么它没有显示人名?

2 个答案:

答案 0 :(得分:2)

试试这个:\

  echo "<h4 align= center><b>Thank You ".$Name."!</b></h4>";

答案 1 :(得分:0)

试试这个,

echo "<h4 align= center><b>Thank You '".$Name."'!</b></h4>";