There's another small problem with this as well, but it's a bit more complex. Once submits this form and creates an appointment, the same page is loaded again. Someone could just press refresh and enter the data in your database again.
There needs to be some condition so that after the form is sent, it can't be sent again (unless you don't care about that).
This will require more validation on the database end, eg. if a user is registered, limit a user to one appointment until that appointment has ended (logical).
But if this type of page is available to unregistered users, then there is no way of validating it.
It's kind of complicated but we'll need more information about the structure of your database if you wish to make it more secure.
Bookmarks