0

I'm trying to create a form post within a larger block of PHP code, but overall my web page fails to load. To troubleshoot this, I've commented out a specific section of code and I think I've found where my error code be, even if I don't know what that error is -- when this code is commented, my page works, albeit without the added content below.

          echo '<form method="POST" action="addPeople.php">
                First Name: <input type="text" name="FirstName"><br>
                Last Name: <input type="text" name="LastName"><br>
                Birthdate: <input type="text" name="Birthdate"><br>
                Birth City: <input type="text" name="BirthCity"><br>
                Birth State: <input type="text" name="BirthState"><br>
                Region: <input type="text" name="Region"><br>
                <input type="submit" name = "submit" class="button tiny round" value="Add Person" />
                </form>'

Have I overlooked a syntax error with my quotations? Or maybe I'm just not handling the form method correctly? Would really appreciate some insight.

1
  • If you have error reporting enabled then it should be displaying a syntax error. Commented Apr 21, 2018 at 16:34

1 Answer 1

2

You forgot the ;.

Try :

echo '<form method="POST" action="addPeople.php">
                First Name: <input type="text" name="FirstName"><br>
                Last Name: <input type="text" name="LastName"><br>
                Birthdate: <input type="text" name="Birthdate"><br>
                Birth City: <input type="text" name="BirthCity"><br>
                Birth State: <input type="text" name="BirthState"><br>
                Region: <input type="text" name="Region"><br>
                <input type="submit" name = "submit" class="button tiny round" value="Add Person" />
                </form>';
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.