我有这个任务,我应该打印出我在表格上的所有内容。表单本身工作正常,但我的php fil不是。
这是该文件的php部分:
if($_POST)
{
$firstName = $_POST["firstName"];
$lastName = $_POST["lastName"];
$areaCode = $_POST["areaCode"];
$firstHalf = $_POST["firstHalf"];
$secondHalf = $_POST["secondHalf"];
$address1 = $_POST["address1"];
$address2 = $_POST["address2"];
$zipcode = $_POST["zipcode"];
$state = $_POST["state"];
echo "Name: <br/>";
echo $firstName . " " . $lastName . "<br/>";
echo "Phone number: " . "(" $areaCode . ")" . $firstHalf . "-" . $secondHalf . "<br/>";
echo "Address: " . $address1 . ", " . $address2 . ", " . $state ", " . $zipcode . "<br/";
}
?>
当我使用页面的php部分时,它加载正常。
有什么建议吗?
答案 0 :(得分:1)
问题出在最后一行
echo "Address: " . $address1 . ", " . $address2 . ", " . $state ", " . $zipcode . "<br/";
在.
$state
echo "Address: " . $address1 . ", " . $address2 . ", " . $state . ", " . $zipcode . "<br/";