Is there a way to create a new HTML page from Javascript based on user inputs?
I have a webpage that asks which input fields user wants, based on the selection it should create a new HTML page.
i.e. If i select 3 textboxes and 1 button then it should create new HTML page with 3 textboxes and 1 button.
how to do the same thing using PHP?
edit: my objective is newly created page should also be saved on the server at the time of creation
No, it’s not possible using only browser-based code. The code in the browser runs on the client machine. It has no way to save a file on the server by itself. You will have to use some code on the server to achieve such thing.
You have two options:
Create new window with the new content – once closed it will be gone as you can’t save it to the server but for all other matters it will act as real HTML page.
Using simple server side logic you can use AJAX to interact with it and create the pages.