0

所以我有一些 PHP,我试图从前一页的表单中引入一些数据,并在这个 <<

$firstname = echo $_POST["firstname"];
$email = echo $_POST["email"];

$data = <<<STRING
<contact>
<Group_Tag name="Contact Information">
<field name="First Name">$firstname</field>
<field name="E-Mail">$email</field>
</Group_Tag>
</contact>
STRING;
4

2 回答 2

3
$firstname = echo $_POST["firstname"];

你想在这里达到什么黑魔法?!

把那个丑陋的 echo 关键字放在这里。您正在分配一个变量。没有从 echo 分配结果……</p>

$firstname = $_POST["firstname"];
$email = $_POST["email"];
于 2013-10-10T17:50:28.223 回答
0

换行

 $firstname = echo $_POST["firstname"];

 echo $firstname = $_POST["firstname"];
于 2013-10-10T17:52:09.313 回答