I don’t know why the code below isn’t printing as it should.
<html>
<head>
<title>Form</title>
</head>
<body>
<h1>Enter your name</h1>
<?php
//way to tell if the form has been submitted (If form not submitted, display form again.)
if (!isset($_post['yourCity'])){
?>
<form method="post" action="" />
<input type="text" name="yourCity" />
<input type="submit">
</form>
<?php
//Process input
}
else
{
// Retrieve information from form submission.
$city = $_POST['yourCity'];
echo "Your city $city";
}
?>
</body>
</html>