Plan
I intend to use PHP and MySQL in order to create an initial version of the interface able to display the stock symbol, quantity, price, and change within session for each of the companies or corporations held by each of the users. This phase of the project will involve work on three fronts: MySQL databases containing pertinent information regarding users, PHP programs that use the database and information from Yahoo! Finance to prepare the data for display, and PHP pages on which to show the results in the form of an interface. As a result of this iteration, the field through which one can obtain technical data, available on the home page, will no longer be the primary result of this project. A series of separate pages for the interface will be made in accordance with the design described below.
Design
I will add tables to my MySQL account to include information regarding sample users and their portfolios. Users can access their accounts by entering the correct password on interface.php. Code on viewer.php will lead to the resulting page, portfolio.php, which includes code to obtain the necessary data from the MySQL tables and Yahoo! Finance and to display them appropriately. Functions to manipulate tables will be used to retreive data from the MySQL account. Methods developed in previous iterations to obtain information from the web site, including the procedure for reading a page and the use of the function preg_match and other functions to modify strings as needed. The established practice of using echo statements to display the information in a table will be used again to maintain continuity in the portrayal of results.
Code
In the above pages, I indicated that coding will occur in PHP on the three pages with .php extensions. Using echo statements allows for HTML code to be embedded in the PHP pages, providing appropriate results on portfolio.html. The ability to display results in the language used for programming will allow the code to validate itself by displaying the desired results. The use of forms on interface.php will be the mechanism that triggers the transition from interface.php to portfolio.php, aided by checking the password in viewer.php. I will use basic functions of MySQL to create the necessary tables. In fulfilling the general requirements for Quarter II, I will comment all code clearly and abundantly.
These links provide the code, as text files, for interface.php, viewer.php, and portfolio.php.
Test
I accomplished the objectives declared in the above plan, completing the iteration as intended. The results for this iteration are available on the portfolio for this project as interface.php, from which one can access portfolio.php, provided that they enter the correct password. The resulting page will change as I make improvements and additions in order to increase the functionality of the interface to the desired level. I had intended at this time to address the problem of delay in the loading of results noted in earlier reports, but this problem proved less pervasive during this phase of the project. Therefore, I possibly will work on this issue in later stages of optimization. The next iteration involving coding will work to expand the functionality of the interface, in a manner similar to the expansion of retrieval of data in Iteration V after obtaining limited amounts of data in Iteration IV.