Create a fun game kind of a program. Use PHP to write a service that could be saved in a file animation.php, that outputs a single frame from a student's textnimation.txt file. Each student’s animation data is stored on the web server with your PHP file, in a student’s directory within subdirectories that have the same names as the students. For example, student Jaden animation data is stored in students/jaden/textanimation.txt. Suppose that the contents of that file are those shown below.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Create a fun game kind of a program. Use PHP to write a service that could be saved
in a file animation.php, that outputs a single frame from a student's textnimation.txt
file. Each student’s animation data is stored on the web server with your PHP file, in a
student’s directory within subdirectories that have the same names as the students.
For example, student Jaden animation data is stored in
students/jaden/textanimation.txt. Suppose that the contents of that file are those
shown below.
• The service is sent a request parameter named student that corresponds to a
student whose animation data should be retrieved.
• The service also accepts an optional second parameter named frame
specifying which frame of the animation to output, 0-based.
• If this parameter is not passed, frame 0 (the first frame) is used.
• Recall that frames are separated by a line of =====.
So for example, if your web service is contacted using the URL of
animation.php?student=jaden&frame=2, the following should be the output:

NB: Your output should use the text/plain content type.

You may have to consider the following:
• If the student parameter is not passed or refers to a nonexistent file/directory,
the service produces no output or error.
• If the frame parameter is passed with a negative value, or a value greater than
the number of frames in the student’s file, no output or error is produced.

students/jaden/textanimation.txt
animation.php?student=jaden&frame=2, output
ol
Transcribed Image Text:students/jaden/textanimation.txt animation.php?student=jaden&frame=2, output ol
So for example, if your web service is contacted using the URL of
animation.php?student=jaden&frame=2, the following should be the output:
students/jaden/textanimation.txt
animation.php?student=jaden&frame=2, output
o//\o
NB: Your output should use the text/plain content type.
Transcribed Image Text:So for example, if your web service is contacted using the URL of animation.php?student=jaden&frame=2, the following should be the output: students/jaden/textanimation.txt animation.php?student=jaden&frame=2, output o//\o NB: Your output should use the text/plain content type.
Expert Solution
steps

Step by step

Solved in 5 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY