One of the current assignments is to create a PHP website that can browser televisions, with functions for adding and removing televisions. This should be helpful for improving my abilities with MySQL databases.
While searching for useful functions, I looked into SQL injections and how to prevent them, since they pose a danger to databases. This lead me to prepared statements, which sends the queries and specified values separately. Making sure to use these when necessary will prove to be important for my own project.
One of the most difficult things to add to the assignment was the function to delete database entries. Not because of deleting the database entry itself, but the image linked to it. The images are linked to the database by a filepath, allowing for easy access to the stored image. However, I'm not entirely sure on the best method to access a single value from a single row of a database yet. I got around the issue by using the same method of pulling data used to fill out tables containing the database information, but I feel there has to be a more efficient method available.
After a short period, I got tired of having to update the navigation links in every PHP file whenever I added a new page to a website. The solution I found was to use the include PHP function to add another PHP file containing only the code used in the header. Using these kinds of templates in my own project could prove to be very helpful and efficient.
Friday, 7 December 2018
Saturday, 1 December 2018
Project Update: A Couple Thoughts
Now that the theory assignments are out of the way, I should be able to better focus on the project.
While I started by assuming that most of the coding would be PHP, many features, such as a rating system, may require more JavaScript than previously thought. As such, the Mozilla Developer Community may prove more useful than I had previously considered.
In the last theory assignment, the concept of user accounts came up, and I managed to find a web page that described how such systems work in basic terms, although little in the way of actual coding. The concept of salting and hashing passwords did come up, and should be looked into further to follow basic security principles on the site, along with figuring out PHP sessions.
One idea I had came to me, looking at Steam's workshop URLs. Each file page there ends with the pattern '?id=123456789', a format which is generally added to the URL by a GET request. With this idea, creating individual pages for articles on the website could be unnecessary, as a 'template' page can be created instead, using a GET request to pull needed information from a database.
While I started by assuming that most of the coding would be PHP, many features, such as a rating system, may require more JavaScript than previously thought. As such, the Mozilla Developer Community may prove more useful than I had previously considered.
In the last theory assignment, the concept of user accounts came up, and I managed to find a web page that described how such systems work in basic terms, although little in the way of actual coding. The concept of salting and hashing passwords did come up, and should be looked into further to follow basic security principles on the site, along with figuring out PHP sessions.
One idea I had came to me, looking at Steam's workshop URLs. Each file page there ends with the pattern '?id=123456789', a format which is generally added to the URL by a GET request. With this idea, creating individual pages for articles on the website could be unnecessary, as a 'template' page can be created instead, using a GET request to pull needed information from a database.
Subscribe to:
Posts (Atom)