Answered step by step
Verified Expert Solution
Question
1 Approved Answer
wuestion 1-3 only 1. Identify and correct the error in each of the following PHP code examples: a. [2 marks] b. [2 marks] c. $
wuestion 1-3 only
1. Identify and correct the error in each of the following PHP code examples: a. [2 marks] b. [2 marks] c. $ value =1000; print (value); ?> [2 marks] 2. Write a function named find_average which takes an array of numbers, and returns the average of those numbers. [6 marks] 3. Write a PHP script named parishes.php that creates a variable \$parishes with the value "Kingston Manchester St. Catherine Clarendon". The script should perform the following tasks: a. Search for a word in \$parishes that end in don. Store this word in element 0 of an array named $ parishes.Array. b. Search for a word in \$parishes that begins with k and ends with n. Perform a casesensitive comparison. Store this word in element 1 of $ parishesArray. c. Search for a word in \$parishes that begins with m and ends with r. Store this word in element 2 of \$parishesArray. d. Search for a word in \$parishes that ends with e. Store this word in element 3 the array. e. Search for a word in \$parishes at the beginning of the string that begins with s. Store this word in element 4 the array. f. Output the $ parishesArray to the screen. [18 marks] 4. List 3 differences between using GET and POST to submit a form. [3 marks] 5. Write a code snippet that creates a session and stores a username submitted by a form [5 marks] 6. A restaurant ranking website needs to way to allow visitors to rank their experiences with various types of restaurants. The ranking ranges from 1 being absolutely dreadful to 10 being excellent. a. Write the HTML for the form for this survey using text fields to accept all the input. The form should be submitted to a function called handle_form.php. The form should accept: i. Name of the restaurant ii. Type of food iii. Rating [10 marks] Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started