Php Examination ztc

Page 1

ZANZIBAR TECHNOLOGY COLLEGE FUNDAMENTAL TO PHP PROGTAMMING TEST 2 Date: 26th July 2014 Duration: 2.5 Hrs Instructions:      

This paper consist of three sections, A, B, and C Answer all questions in each section You will be given one section at a time and the next section only when you claim to finish the current It is recommended to save time for later sections if you can go faster with the current Full marks will be awarded only on the ability to display a given task on a browser window All ZTC examination regulations applies

Section A (5 marks, 20 min) 1. Write a php function that has an array which stores the names of the twelve months and then display only the values (names of months) of the array of which their array indices are odds. i. Call the function to demonstrate its implementation ii. Save your work in a php file named question1.php


Section B (10 marks, 60 minutes) 2. You are provided with a php file named question2.php, study the file carefully and accomplish the following task.

Figure 1: Page view of question2.php

Tasks: On each of the three white div boxes, write jQuery codes meet the described effects i. When a mouse enter the white div box a. The width of the white div should increase to fill the container div, i.e 100% width. b. Show the contents of the white div (div box inside the white div) which are hidden by default. ii. When a mouse leave the white div box a. Hide the contents of the white div (div box inside the white div) b. The width of the white div should decrease to its original size, i.e 20% width.

Figure 2: Mouse enter on third white div box


Section C (10 marks, 60 minutes) 3. You are given a website in folder named question3; the website is from a client who wants the style-demo page of the website, which currently contains a table with static data, to use the existing styles to load data directly from the database.

Figure 3: Page view of style-demo.html

Your task: i. ii. iii.

Import test2 database script to your MySQL server Convert the style-demo.html page to php page. On the same file, a. Write php codes to connect to test2 database. b. Fetch data from address table and c. Fill fetched data to table on style-demo page.

NOTE: Do note change the styles of the table


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.