提交表单结果,打印到第二个URL?

I have no idea how to do this so looking for some direction. I’ve got a form on ‘page-a’ behind a staff login and a separate public ‘page-b’. I would like the submitted form fields from ‘page-a’ to populate the content on ‘page-b’ until the next time it is submitted.

I was thinking I might need to create a JSON file that outputs the results of the form and call upon that JSON in page-b?

This is an example of passing state between HTML pages on different URLS.

You are correct that the state can be saved by the php application (eg as an associative array or JSON structure).

You would need also to decide if form B was likely to be activated very soon after form A, or "next week" for example. In the latter case you would need to persist the data in a database or file at the server side.

When "form B" needs the data, it would issue an Ajax request on the server. The server would recover the data, format it (eg JSON), and send it back. At the browser end, you then need to populate the "form B" DOM with the recovered data.

It is all about communication between different pages. Hence, to achieve this you can create a singleton storage service and whenever form is submit you can set the response as per the filled data into the storage service from page-a and then you can get the stored data into the page-b.

storageService = {

    formData: {
        name: '',
        email: ''
    },

    SaveState: function () {
        localStorage.setData = JSON.stringify(storageService.formData);
    },

    getState: function () {
        storageService.formData = JSON.parse(localStorage.setData);
    }
}