Write a complete PHP web service Ama2000.php that processes the data containing the names of the babies which are born early 2000’s. The PHP service reports the best (lowest) popularity ranking that name has ever held in the South African Home Affairs database. Create a service which accepts a GET request parameter called name with the following cases: • Its output is a single line of plain text containing the best ranking number, or -1 if no name parameter is passed or if the name is not found in the file. • The input file to read, ama2000.txt, is in the below format, with each line containing a baby's first name followed by some number of popularity rankings. The sample data below has 11 rankings per line, but for full credit your code should work regardless of how many rankings (1 or more) are on each line assigned to a name. Bontle 31 25 24 26 30 46 93 163 209 289 382 Bonang 66 79 84 94 93 78 70 108 127 142 177 Bohlale 631 752 712 664 720 933 636 752 680 856 918 Martha 44 55 16 66 898 977 98 567 38 89 90 128 678 890 Martin 69 58 34 68 45 76 28 78 98 90 78 87 84 83 85 97 Mart 55 88 09 87 54 56 78 65 78 65 76 34 76 89 ...... For example, if your service were requested as Ama2000.php?name=Bontle, its output would be 24, since that is Martha’s best popularity ranking. • If the request is Ama2000.php?name=Bonolo, its output would be -1 since that name is not in the file. • If the request is Ama2000.php?name= 66, its output would be -1 since that name is not in the file. • If the request is Ama2000.php?name= B, its output would be -1 since that name is not in the file. • Assume John is the file has ranking of 88 16 34 16 590 67 265 987 657 87 545, If the request is Ama2000.php?name= John, its output would be 16 since the ranking 16 appears twice in the file. Ensure that your code matches case-insensitively; for example, the request Ama2000.php?name=BoHLalE should match the

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

Write a complete PHP web service Ama2000.php that processes the data containing the
names of the babies which are born early 2000’s. The PHP service reports the best (lowest)
popularity ranking that name has ever held in the South African Home Affairs database.
Create a service which accepts a GET request parameter called name with the following
cases:
• Its output is a single line of plain text containing the best ranking number, or -1 if no
name parameter is passed or if the name is not found in the file.
• The input file to read, ama2000.txt, is in the below format, with each line containing a
baby's first name followed by some number of popularity rankings.
The sample data below has 11 rankings per line, but for full credit your code should work
regardless of how many rankings (1 or more) are on each line assigned to a name.
Bontle 31 25 24 26 30 46 93 163 209 289 382
Bonang 66 79 84 94 93 78 70 108 127 142 177
Bohlale 631 752 712 664 720 933 636 752 680 856 918
Martha 44 55 16 66 898 977 98 567 38 89 90 128 678 890
Martin 69 58 34 68 45 76 28 78 98 90 78 87 84 83 85 97
Mart 55 88 09 87 54 56 78 65 78 65 76 34 76 89
......
For example, if your service were requested as Ama2000.php?name=Bontle, its output
would be 24, since that is Martha’s best popularity ranking.
• If the request is Ama2000.php?name=Bonolo, its output would be -1 since that name
is not in the file.
• If the request is Ama2000.php?name= 66, its output would be -1 since that name is
not in the file.
• If the request is Ama2000.php?name= B, its output would be -1 since that name is
not in the file.
• Assume John is the file has ranking of 88 16 34 16 590 67 265 987 657 87 545, If the
request is Ama2000.php?name= John, its output would be 16 since the ranking 16
appears twice in the file.
Ensure that your code matches case-insensitively; for example, the request
Ama2000.php?name=BoHLalE should match the name Bohlale in the data file.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
Linux
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education