I have made an interface whereby the user can create his own form. I’ve just managed to load that form in a separate php file.
What I want to know is that after posting the form, how do I capture all the id and values of the inputs in an array so that I can display the the form (read-only) and display it on another page.
If your
<form>methodattribute ispost– you send POST request to server. You can access all POST data through$_POSTlikevar_dump($_POST);.If your
<form>methodattribute isgetor you have nomethodset – you send GET request to server. You can access all GET data through$_GETlikevar_dump($_GET);.No matter which input fields was in form – they all would be here.
But this example is not too good. It’s not protected against SQL-injection – pay attention to it. But with it you can get all $_POST data in
$postarray.