PHP Lesson No 5 Description
PHP Lesson No 5 Description
1. The new PHP code is added to dbPhotosCreate.php, index.php and other scripts for
exception handling and for blog displaying on home page
a. please run the dbPhotosCreate.php script to add new tables to database,
which contains blog entries and images
2. Exception and error handling code
a. onephoto.php, mynewphotos.php check if images and thumbnails
directories exist
b. onephoto.php check if images table was properly read from database
c. functLibrary.php / loadPhotos() check if images table exists
d. file-upload-form.php from the security reason don’t display this form for
the user, which is not logged in
header("location: index.php");
Task 1
3. The index.php script displays the blog content: titles, images and texts
a. the blog content is read from database tables: blogs and blogphotos;
prepared statements are used for it
b. $result->fetch_assoc() returns the associative array, indexed by column
names from database table
c. the blog entry is stored in new object of class blogContent; the new class is
defined in functLibrary.php script
1
Websites for mobile devices designing
Task 2
Please add the form to write the comment to blog text, the code to store the comment in
database and the code, which displays the comments under the blog text.