Saturday, August 30, 2008

Final Adjustments

Well, I am glad I took the time to talk with Phil last night. He was able to walk me through several things within the site that were causing it to not function properly.

1. Errorr message positioning: We sorted out the issue with the error messages being hidden behind the header image. It was just a matter of coming up with a $errmsg flag and then adding a div id to position them further down the page.

2. We personalised the welcome page with the username after login. This was just a matter of adding the user_name field to the $query = SELECT on line 35 of the login.php page (and then adding the user_name as a session identifier on line 47 below) and then identifying the user_name session on line 15 of the index.php page. **This may send the session start option out when working with the change_password.php file. Will look into that.

3. The hardest part of all was trying to change the 'submit recipe' form after the recipe has been submitted. It seems to be returning with all fields still filled in even after the recipe is submitted. It took a lot of searching on the net for a solution and then lots of trial and error before we settled on the option of $results, $errmsg, and $success. These are set up as flags on the submit.php page so that the $errmsg picks up any errors when the form is filled out, the $results processes the messages for the results and the $success determines whether the form has successfully completed the validation and processing of information. Once $success registers that it has been successful - 'yes' - then it destroys the form and displays the page with just the $result message and a link back to a new form if the user wants to submit another recipe. Sounds complicated, but works well (Coggeshell, 2001).

4. Another minor issue was that the year and category drop down menu on the 'submit recipe' page didn't have any blank options which meant that the user could skip picking a category and year without it being picked up by an error message. This was very simple. I just added another option value to the top of both menu's which read 'Select'.

5. Also got the individual desserts.php, mains.php etc pages linked to a recipe year by adjusting the $query = SELECT function to include recipe_year.recipe_year in its choice so that I could then identify the related recipe year for each recipe. I also did this with the new 'recipe.php' page and got that working.

So, that is it. There are still some things that I would like to do on the site, but I feel that they are just icing on the cake and can be addressed down the track if I want to complete this project for personal reasons. They are:

1. Complete the design and style of the site
2. Include the 'username' with each result from a recipe search.
3. Improve the format of search results by including linked Recipe Names and a brief description. The link will then expand the recipe results to include all the details of the recipe. This will mean that I may have to add another field to the recipe table - 'recipe_description'.
4. User option to ammend any submitted recipes.
5. Email alert when new recipes have been submitted.

The list could go on. But that is it for now.

No comments: