Forum
Posting to forms from another site
Hey guys
We have 5 Perch sites on different domains and want to capture forms in the primary site. Is it possible to post from domain-a.com to domain-b.com, capture the details in domain-b.com's perch install, then redirect back to domain-a.com?
Each site has its own Perch instance.
Yes, I think so. You'd need to make sure the form template is the same on sites.
How would we do it though? A hidden return URL or something like that?
Yes, you could include the return URL in a hidden form field.
Sorry, Drew. I can't see that in the docs. What name should it be - 'returnUrl'?
There's nothing built in to do that - you'd need to implement it yourself.
Sorry, I think I'm missing the point. How would we do that - changing the code of the forms plugin directly?
You could, but it would be simplest to just write some PHP to do it.
It's not something the software does out of the box, as you'll appreciate it's a very bespoke requirement. If you don't have any development capability at your end, then the answer is probably no, Perch doesn't do that.
I think you could probably create the forms so that they are capable of running on the primary site, and then display each form as an iframe on each secondary site?
I've got the form posting to a separate site and redirecting back. How can I get a PHP value into a form field?
Here's my form template:
I need to output the URL of the current page in the value field so that gets passed along to the destination site as the URL to bounce back to.