Thread tagged as: Question, Forms

Form Submit Question

Drew, This may be a lazy (or crazy) question... but

Can I submit a form to perch which wasn't created by perch? In other words, I have a form which I would like to submit and have perch process into perch forms... but instead of try and find out I am asking you first.

Thanks in advance... RK

Robert Ketter

Robert Ketter 103 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

You can't, no. It's generally not a great idea to have a script that will accept any unknown input from a form. This leaves it open to all sorts of possibilities in terms of attack, be that compromise attempts, DoS, or spam.

To defend against that, you need to know what you expect the form to post, so the input can be validated, correctly escaped, and rejected if necessary.

Perch does that with the form template. When a form submission is received, Perch reads the template for fields, and then looks though the submitted data for those specific fields. This keeps you a lot safer.

It's also why you can't have dynamic IDs in the form template.

Thank you for such an informative answer. I was pretty sure of the answer but I got a lot better understanding now.


Now I have to go learn about dynamic IDs. That's what I love about Perch.