Arthur Figueiredo Arthur Figueiredo - 8 months ago 85
HTML Question

This page isn’t working localhost is currently unable to handle this request

I have this assignment which in which I'm supposed to print out everything I put on the form. The form itself is working fine, but my php fil is not.

This is the php part of that file:


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/";
}

?>


When I take the php part of the page, it loads fine.

Any suggestions?

Answer Source

the issue is in the last line

 echo "Address: " . $address1 . ", " . $address2 . ", " . $state ", " . $zipcode . "<br/";

You are missing a . after $state

 echo "Address: " . $address1 . ", " . $address2 . ", " . $state . ", " . $zipcode . "<br/";
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download