I have a need for website B to grab a form from website A and post the form data to a process on website A. Site A is the 'keeper of data submitted', and site B is an approved client of A that is authorized to collect data on their site B to send to A.

Sample scenario: website B contains a database of clients. Website B (many different sites) need to have a form from website A displayed on their site (B). That form's content needs to be submitted to A (with proper sanitation). The form from A is unique to B, so that site C (and others) can use the same form. The form has a hidden unique GUID field supplied by A when B requests

The form is like a signup form (name, email) for a service that A provides. The form needs to display on B (or other sites) with the data submitted/processed by A.

Some JS code would be inserted on B to display the form from A. Site A has code to process the data that B posts (submits) to A.

Flow would be

B requests a form from A via some process (JS?) that loads the A form on B's page load.
A creates the form plus a unique hidden field
B shows the form on a page on the B site.
B fills the form, and submits to A (action = A)
A receives the posted data from B, and process it
A's processing status (pass/fail) is returned to B

Assume that the returned form data submitted by B is sanitized by A.

Not sure of where to start on this. AJax? Javascript? I write mainly in PHP, but know a bit of JS (with much help from the googles/bings/ducks).

But I am sure there is guidance 'out there' - my searching has not found anything helpful yet.

  • I'm going to vote to move this to StackOverflow where I think it's a better fit. Meanwhile, it might help to say what languages you're familiar with. I've done this several different ways in the way distant past, but the one that seems most appropriate to me would be using RESTful services.
    – Trebor
    Jan 16, 2021 at 3:27
  • @Trebor StackOverflow closed it, because " is not intended to be a referal service. It is a Q&A site. Within the realm of questions and answers, the questions are intended to be about concise issues, not generalized pointers in the correct direction. " So I figured that Webmasters might know how this is done, and asked here. Jan 16, 2021 at 4:03
  • @Trebor I put in a tag of PHP, but I'll add that to the question. Thanks. Jan 16, 2021 at 4:16
  • This question appears to be off-topic because it is about web development which is off-topic at Pro Webmasters. Web development questions may be asked at Stack Overflow but be sure to read their FAQ before posting to ensure your question meets their guidelines. In its current form, this question does not meet their guidelines.
    – John Conde
    Jan 16, 2021 at 13:39

1 Answer 1


I don't think JavaScript is the way to go as it requires A to render JavaScript and if its servers too server its a bad lidea. This can all be done with form post requests.

I believe this is a solved problem - you probably want to research how to use a "REST API", which is a standardised mechanism for systems to communicate with each other over http(s) - there will be libraries you can use forpretty much all common platforms including PHP.

  • Thanks. Basic use is a newsletter signup on site B which sends the data (post) to site A for adding into the newsletter subscriber database (with proper sanitization). The form is provided by A to display on B page. Still searching for examples....on the stacks and googles/bings/ducks. Jan 16, 2021 at 20:20
  • Why don't you have the form in B simply post the data directly to A?
    – davidgo
    Jan 16, 2021 at 21:56
  • I want A to provide the form to B with a simple call on B. Then the submit of the form (by B) will return POST data that A will process. Think of a newsletter signup form (name/email) that you (A) want to easily include on any B site. Jan 17, 2021 at 0:43

Not the answer you're looking for? Browse other questions tagged or ask your own question.