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.

  • If you have [error reporting](https://stackoverflow.com/questions/1053424/how-do-i-get-php-errors-to-display) enabled then it should be displaying a syntax error. – Script47 Apr 21 '18 at 16:34

1 Answers1

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>';
Sébastien S.
  • 1,444
  • 8
  • 14