Below you will find a discussion of the design of Save.
Within the main directory "finalproject" exists a directory called "includes" that is home to configuration.php, which configures the web page, functions.php, which contains important functions for implementing the basic architecture of the website. We made use of the configuration file (config.php) and many of the functions that live in functions.php, including render (to display web page forms), query (to make SQL queries), and redirect (to direct to controller files). Also there exists constants.php, which contains the constants relating to the database and the server.
Inside the next directory, "public," exist all of the forms required to execute the backend data manipulation in PHP. The files expenses.php and limits.php perform two main functions. First, they take the inputted expenses and limits and input them into the MySQL database using the query function. Second, they create arrays of categories of expenses and limits, respectively. These arrays are then rendered to the respective forms, expenses_form.php and limits_form.php, to display the drop down menus. One specific design aspect of expenses.php is that it accepts custom inputs that contain only alphanumeric characters or underscores. Whitespace characters cause problems with SQL queries, meaning that the custom category names can only have alphanumeric characters and underscores. In register.php, besides basic user input checking is the framework for the mail verification system. We decided to implement a verification system to help prevent bots from easily overrunning the server. On the technical side, the PHPMailer system used allows the programmer to modify the host and port to change from which mail server the message will be sent. We decided to use ISP's SMTP server because it was more convenient and could be a dedicated account. In verify.php, we used the function rand() to generate pseudo-random verification numbers to be sent in the body of e-mails to users. Export.php creates a .sql file that is used to backup the MySQL database. When the user clicks on the Dropbox icon, the .sql file is created and is then dumped into one variable to prepare for export. The Dropbox button links to the Dropbox drop-in app that saves the file in Dropbox.
Lastly, in the main directory there exists a .sql file that contains all of the SQL commands for the pre-populated database, with the one sample user created for illustrative purposes. Even though the database lives on a public domain and doesn't need to be populated by the user (as it would be if the database were on the localhost), we thought that it would be beneficial to include it.