Question: I need a typed answer. Consider the PHP code segment, which is used to edit a post. 1.

I need a typed answer.

I need a typed answer. Consider the PHP code segment, which isused to edit a post. 1.

Consider the PHP code segment, which is used to edit a post. 1. a) Complete the code on Block A. The code should check whether the user is an (4 marks) authorized user. Unauthorized users should be redirected to the login.php page. Note: A session called "UserName" is created if he/she is an authorized user. It contains the name of the user. (2 marks) b) Complete the code on Block B, to read and store the item id in the itemid variable. Note: The value is passed as follows: edit.php?id='2' c) Specify the importance of the bolded code segment given from line 15 to 18. (2 marks) d) Complete the code on Block C, to store l in status variable if the published check (4 marks) box is selected or if it is not selected. Note : The check box name is : chkPublished e) Write the SQL query to be stored as the value of variable $sql (Line 19) to update (4 marks) the details of an Item. The structure of the database table is as follows: Table Name : item Field Name Type itemId Auto Generated / Primary key email Varchar (50) title Varchar (50) description varchar(1000) category varchar(10) path varchar(200) published int f) Complete the code on Block D, to execute the query. (2 marks) (2 marks) g) Assume you are using a Cookie to store the path of the image instead of passing via the URL. Write the php code segment to create the cookie

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!