Loading a form from another site on another, what is the best way to implement it?

  • 0
    I put different tags to cover the specialists more. (since I didn't understand which tag to put to such a question).

    There are 5 sites, the first site is the main one, it has a form in the form of fields in the region of 15, as well as css styles are all on the main site, there is validation of the form, data from this form goes to the database, so I want it on to make the main site inaccessible, is it possible? how to hide it.

    On 4 sites, I want to load this form. with styles with validation, it's like a form on the main site, but I load it on other sites.

    All sites on the same hosting.

    What is the best way to implement this?

    I thought of one option, store a form with validation and all css styles on 4 sites, and so that by api the data would go from the form to the main site in the database. but so after all, it’s more hemorrhagic, if you need to change the shape of a friend, well, modify it, then you have to throw the form itself and all the scripts to where the form is.
    JavaScript Willow Hawkins, Oct 1, 2020

  • 1 Answers
  • 0
    Prepare a separate php page with a form, and nothing else on it.



    Either through IFRAME, or through AJAX on additional sites, display the content of this page.

    (if via AJAX - do not forget to send the corresponding HTTP header on the page)



    On the main site, do not include in the site pages, that's all)
    Anonymous

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!