So far we have a web app design we can work from, we also now have a way that the user can log in to the web app. Using the login method, we can now create a form where the user can submit recipe’s to the ‘post’ table in the database. Using the ‘post’ table, we can then display the information on web app using the user’s inputted recipes.
To start such a task, it is important that we first start off with the form that can be visually seen in the html standards using php actions:
And to create the visuals for it, I then went on to create the CSS of the form:
Now that we have a form, we need to make sure the data that is being inputted and is being inserted into the ‘post’ table. But before we do that, we need to consider that the form can only exist if the user is logged in. This is the writing privilege of the web app:
As you can see from the screenshot above, the user can only post if the ‘login’ post is successful.
From here, we can then insert the data into the database and write messages if fields are left blank:
With all these blocks of code combined accordingly, the user is now able to log in, and submit a recipe to the database. Once it has been submitted to the database, it will display the results of the recipe on the home page of the web app.