I'm interested in what might be the options for securely implementing a dead simple API that allowed websites to register on my site, receive and copy the unique HTML form to their website that would ultimately post to my API.
E.g.:
- A church at URL: www.church.com buys 5 submits of my service.
- I provide that church a HTML form that they then copy into their website.
2b. The form would post back to my API/URL with an unique key specifying it's coming from www.church.com (key=1234)
<form action="https://www.example.com/myCustomAPIService.php?key=1234" method="post">
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br>
<input type="submit" value="Submit">
</form>
What would prevent say another organization from copying the HTML to their site?
Would checking $_SERVER["HTTP_REFERER"] solve this problem?