Thursday, 22 October 2009

Submitting A Dream

After yesterday's troubles with lack of inspiration I decided to make a start on one of the main functions of the website - submitting a dream. To do this I needed to create a form to allow the user's to fill in and a database that would store the data that is being input via the form. After creating these two elements of the website, I had to link them with PHP. It took me a while to write the code. I first got the ID number of the dream increasing when the submit button was clicked. However, I could not understand why the data that was being entered in the fields were not being entered into the database. It took a while of going back and through the code until I realised that the variables I set at the start of the PHP script were not written in all lowercase as they started with a capital letter. As soon as I changed this and clicked on the submit button with data in the form, the data was being submitted to the correct fields in the table of the database. This was a good learning point for me, as I now realise that I need to write all code in lower case letters.

No comments:

Post a Comment