Question: Q2 QUESTION 2 a. Based on the figures below, answer the following questions: i. Write a HTML program named Add.html that will display an output

Q2
Q2 QUESTION 2 a. Based on the figures below, answer the following
questions: i. Write a HTML program named Add.html that will display an

QUESTION 2 a. Based on the figures below, answer the following questions: i. Write a HTML program named Add.html that will display an output shown as in Figure 1 and send the data to a filename Add.php and the method is POST. Figure 1: Add.html (5 marks) 1. Based on Question 1(a), write a PHP code that will validate each text field and produce an error message as shown in Figure 2 if the fields are left blank. (5 marks) Figure 2: Add.php ii. Based on Question 1(a), write a PHP code that will validate each text field and produce an error message as shown in Figure 2 if the fields are left blank. (5 marks) Figure 2: Add.php ill. Create a database connection file (config.php) which are the database name is usersite, executed from localhost, user id is root and no password needed to connect to the server. (5 marks) iv. Write a PHP file name view_user.php that will display the output shown in Figure 3 in your web browser. All data are retrieved from table student as shown in Table 1. Name Age Email Farah 23 farah amal.com Ahmad Nazr 21 nazilgmail.com Nurul 30 nuru hamail.com Figure 3: view_user.php Table 1: Table student Field TypeNull Key Extra user_id int(3) no primary auto increment name varchar(50) no age varchar(2) no email varchar(30) (5 marks) QUESTION 2 a. Based on the figures below, answer the following questions: i. Write a HTML program named Add.html that will display an output shown as in Figure 1 and send the data to a filename Add.php and the method is POST. Figure 1: Add.html (5 marks) 1. Based on Question 1(a), write a PHP code that will validate each text field and produce an error message as shown in Figure 2 if the fields are left blank. (5 marks) Figure 2: Add.php ii. Based on Question 1(a), write a PHP code that will validate each text field and produce an error message as shown in Figure 2 if the fields are left blank. (5 marks) Figure 2: Add.php ill. Create a database connection file (config.php) which are the database name is usersite, executed from localhost, user id is root and no password needed to connect to the server. (5 marks) iv. Write a PHP file name view_user.php that will display the output shown in Figure 3 in your web browser. All data are retrieved from table student as shown in Table 1. Name Age Email Farah 23 farah amal.com Ahmad Nazr 21 nazilgmail.com Nurul 30 nuru hamail.com Figure 3: view_user.php Table 1: Table student Field TypeNull Key Extra user_id int(3) no primary auto increment name varchar(50) no age varchar(2) no email varchar(30)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!