I am developing a website that will have ten different pages for ten different properties. Each page will have two forms one to set up an appointment and one for something else. How do I process each form? Right now I have a processing page for each form. So a total of twenty different processing pages. For all variables, names, and Ids, I add a 2..3...4..etc. for each form. Is this the correct way of doing it?
<form role="form" id="apptform2" name="apptform2" action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']); ?>" method="POST">
<div class="form-group cushion">
<label for="apptName2">Full Name*</label>
<input type="text" name="apptName2" class="form-control" id="apptName2" placeholder="Last, First">
<?php if (isset($apptErrors2['apptNamePgTwo1'])) { echo '<div class = "pink-text"/><p>', $apptErrors2['apptNamePgTwo1'] , '</p></div>'; } ?>
<?php if (isset($apptErrors2['apptNamePgTwo2'])) { echo '<div class = "pink-text"/><p>', $apptErrors2['apptNamePgTwo2'] , '</p></div>'; } ?>
<?php if (isset($apptErrors2['apptNameLengthPgTwo'])) { echo '<div class = "pink-text"/><p>', $apptErrors2['apptNameLengthPgTwo'] , '</p></div>'; } ?>
</div>
<div class="form-group cushion">
<label for="apptEmail2">Email address*</label>
<input type="email" name="apptEmail2" class="form-control" id="apptEmail2" placeholder="Email">
<?php if (isset($apptErrors2['apptEmailPgTwo1'])) { echo '<div class = "pink-text"/><p>', $apptErrors2['apptEmailPgTwo1'] , '</p></div>'; } ?>
<?php if (isset($apptErrors2['apptEmailPgTwo2'])) { echo '<div class = "pink-text"/><p>', $apptErrors2['apptEmailPgTwo2'] , '</p></div>'; } ?>
</div>
<div class="form-group cushion">
<label for="apptPhone2">Phone*</label>
<input type="text" name="apptPhone2" class="form-control" id="apptPhone2" placeholder="Phone">
<?php if (isset($apptErrors2['apptPhonePgTwo2'])) { echo '<div class = "pink-text"/><p>', $apptErrors2['apptPhonePgTwo2'] , '</p></div>'; } ?>
</div>
<div class="form-group cushion">
<label for="apptMessage2">Message:</label>
<textarea class="form-control" name="apptMessage2" rows="5" id="apptMessage2"></textarea>
</div>
<div class="cushion text-center">
<button type="submit" name="appt-form-2" class="btn btn-danger btn-md">Request</button>
</div>
</form>