In this article I want to provide a tutorial on how to create input and output forms with PHP without a database.
What is Form? In a website form usually functions to receive data input from users or website visitors then the data will be stored and will appear again if we need it. Form in general is an interface that functions to collect user data.
An ordinary input output form uses a database as data storage. But in this simple tutorial I will use an Array instead of a database which functions to temporarily store data.
Without any length, just go to the tutorial.
How to Create Simple Input and Output Forms with PHP
- Open your text editor software.
- First we will create an input form display first
Note: At the top of the form making uses the POST method which functions to send data directly, which is different from the GET method which functions to send indirect data so that the data is visible in the URL. Where the date  is an array variable that functions to store data. And later it will be called back when the data is needed.
- And it will look like the following image
- Then add the code below right above to call and save the input form data using an Array, and also make the output data display
Note: Shown above $ name = $ _POST [‘name’]; You can use this command to call the post method that you created earlier then re-initialize it using PHP. Then the function of Foreach there is used for loops whose data is an Array, and later the loop will be called using echo $ nama [$ key] ;.
- And here is what the output will look like when you input the data
Maybe that’s all my tutorial on How to Create Simple Input and Output Forms with PHP without a Database, hopefully it’s useful, and don’t forget to share this article with those who need it.