Question: Instructions Assignment 3: Movie Review Part 2 (PHP) What you need to do ? Apply PHP basic control and data structures to create dynamic web

Instructions Assignment 3: Movie Review Part 2 (PHP)

What you need to do ? Apply PHP basic control and data structures to create dynamic web pages ? Apply PHP to handle files Requirements For this assignment you will write PHP code for movie review pages much like your Assignment 2. Your PHP code will allow you to generate reviews for a variety of movies using the same code. For example:

Create the following files: ? movie.php (code to produce review pages for movies) ? movie.css (the style sheet for your pages) You should base your movie.php on the moviereview.html you wrote in Assignment 2. You can also reuse your style sheet, movie.css. The modifications you need to make to your HTML code are to cause it to read the movie information using PHP so that the same file can produce different movie review pages.

*Remember, in this assignment, feel free to show your hard work and creativity and you are welcome to use your own code, design, styles and images in creating your own web page!* These are only outlines, be creative and make it your own. Dynamic Page Content: Your movie.php page will show reviews of different movies based upon a query parameter that is passed from the browser to the page in its URL. See example: https://www.rottentomatoes.com/m/princess_bride. Your PHP code can store this parameter into a variable using code such as the following: $movie = $_REQUEST["film"]; You may assume that the browser has properly supplied this parameter and has given it a valid value. You do not have to handle the case of a missing or empty film parameter, a value that contains bad characters, a value of a movie that is not found, etc. Based upon the film requested by the browser, you are to display a review of that film. Each film is stored in a directory whose name is the same as the film parameter. For example, the film princessbride stores its files in a folder named princessbride/.

The files associated with each movie can be the following: info.txt - a file with exactly four lines of general information about the film: its title, year, overall rating, and number of reviews. Example:

The Princess Bride 1987 95 7

overview.txt, a file with information to be placed in the General Overview section of your page. Each line contains one item of information, with its title and value separated by a colon. The number of lines in the file varies from movie to movie. Example:

STARRING: Cary Elwes, Robin Wright, Andre the Giant, Mandy Patinkin DIRECTOR: Rob Reiner PRODUCER: Arnold Scheinman, Rob Reiner SCREENWRITER: William Goldman RATING: PG RELEASE DATE: September 25, 1987 (USA) RUNTIME: 98 min SYNOPSIS: Director Rob Reiner breathes vividly colored cinematic life into ... RELEASE COMPANY: 20th Century Fox

Coding style: Implement the HTML output of your web page using HTML as taught in class. Do not use HTML tables on this assignment. Your PHP code should generate no errors or warning messages when run using reasonable sets of parameters. Decompose the problem into functions as appropriate, minimize global variables, utilize parameters/returns properly, correctly use indentation/spacing, and avoid long PHP lines over 100 characters. Use material that was covered in class as well as the various resources you have use online. Use loops, functions, variables, if/else factoring, etc. to ensure that your code is not redundant. Another focus on this assignment is commenting. HTML and CSS are simple declarative languages; in PHP you are implementing complex algorithms. You should have much more commenting in your PHP than we have expected so far. Put a descriptive header (name, course, description of assignment, etc.) at the top of your code, and a well-written comment on each major section of code and function explaining in detail what that code is doing. For better code, you should reduce the number of large complex chunks of PHP code that are injected into the middle of your HTML code. When possible, try to replace such chunks with functions that are called in the HTML and declared at the bottom of your file. Also, you should minimize the use of print and echo statements. As much as possible you should insert dynamic content into the page using PHP expression blocks as.

CSS is not a major part of this assignment, but you should not introduce new poorly written CSS code. If possible, do not express stylistic information in HTML, such as inline styles or presentational HTML tags.

*Again, in this assignment, feel free to show your hard work and creativity and you are welcome to use your own code, design, styles and images in creating your own web page!* Development Strategy and Hints: - PHP code is difficult to debug if you have lots of errors on your page. It is wise to write this program incrementally, adding small pieces of code to a known working page, and not advancing until you have tested and debugged the new code. Rather than trying to generalize all of your page at once, focus on incorporating a particular aspect or input file. Once this is successful, move on to the next. - We suggest that get your page to display a single film (such as princessbride or seabeast) first, then generalize it for other films. None of your code should refer to specific names of films such as princessbride. - Since this program uses PHP code, you will need to upload your files to the web to test your work. Changes you make to your files will not be shown in the browser until you reupload the file and refresh. - The following PHP functions may be helpful to you in implementing this program:

  • count - returns the number of elements in an array
  • explode - breaks apart a string into an array of smaller strings based on a delimiter
  • file - reads the lines of a file and returns them as an array
  • glob - given a file path or wildcard such as foo/bar*.jpg, returns an array of matching file names
  • list - unpacks an array into a set of variables; useful for dealing with fixed-size arrays of data
  • trim - removes whitespace at the start/end of a string (gets rid of stray spaces in output)

Turn-in Please create a zip file with the name following this convention: uanetid_hw3.zip. This zip file should contain all the files you generated as part of this assignment. Once constructed, submit this zip file to the Assignments folder Assignment 3 at D2L site. You still need to turn in your movie.css even if it did not change from HW2. Additionally, please post your work to your password-protected web space within your U-System account and submit the URL within your D2L dropbox submission notes. In addition to the URL, please also provide me the password for user carlcanlas to access your protected web folder in your submission note. Rubric This assignment is worth a total of 100 points. I will check the below components when grading your work: ? (30 points) Web Appearance ? (50 points) Dynamic page content ? (20 points) Coding style Again, even if your web folder is not protected, you need at least to upload your files into your U web space. And provide me an URL to access your web page(s) and grade. I will not grade your submission without the URL attached. If your folder is protected, please provide me the password for user carlcanlas to access your protected web folder in your submission note attached with your submission work in the D2L dropbox.

" style="display: block; overflow-wrap: break-word; overflow: auto hidden;">

Assignment 3: Movie Review Part 2 (PHP)

What you need to do ? Apply PHP basic control and data structures to create dynamic web pages ? Apply PHP to handle files Requirements For this assignment you will write PHP code for movie review pages much like your Assignment 2. Your PHP code will allow you to generate reviews for a variety of movies using the same code. For example:

Create the following files: ? movie.php (code to produce review pages for movies) ? movie.css (the style sheet for your pages) You should base your movie.php on the moviereview.html you wrote in Assignment 2. You can also reuse your style sheet, movie.css. The modifications you need to make to your HTML code are to cause it to read the movie information using PHP so that the same file can produce different movie review pages.

*Remember, in this assignment, feel free to show your hard work and creativity and you are welcome to use your own code, design, styles and images in creating your own web page!* These are only outlines, be creative and make it your own. Dynamic Page Content: Your movie.php page will show reviews of different movies based upon a query parameter that is passed from the browser to the page in its URL. See example: https://www.rottentomatoes.com/m/princess_bride. Your PHP code can store this parameter into a variable using code such as the following: $movie = $_REQUEST["film"]; You may assume that the browser has properly supplied this parameter and has given it a valid value. You do not have to handle the case of a missing or empty film parameter, a value that contains bad characters, a value of a movie that is not found, etc. Based upon the film requested by the browser, you are to display a review of that film. Each film is stored in a directory whose name is the same as the film parameter. For example, the film princessbride stores its files in a folder named princessbride/.

The files associated with each movie can be the following: info.txt - a file with exactly four lines of general information about the film: its title, year, overall rating, and number of reviews. Example:

The Princess Bride 1987 95 7

overview.txt, a file with information to be placed in the General Overview section of your page. Each line contains one item of information, with its title and value separated by a colon. The number of lines in the file varies from movie to movie. Example:

STARRING: Cary Elwes, Robin Wright, Andre the Giant, Mandy Patinkin DIRECTOR: Rob Reiner PRODUCER: Arnold Scheinman, Rob Reiner SCREENWRITER: William Goldman RATING: PG RELEASE DATE: September 25, 1987 (USA) RUNTIME: 98 min SYNOPSIS: Director Rob Reiner breathes vividly colored cinematic life into ... RELEASE COMPANY: 20th Century Fox

Coding style: Implement the HTML output of your web page using HTML as taught in class. Do not use HTML tables on this assignment. Your PHP code should generate no errors or warning messages when run using reasonable sets of parameters. Decompose the problem into functions as appropriate, minimize global variables, utilize parameters/returns properly, correctly use indentation/spacing, and avoid long PHP lines over 100 characters. Use material that was covered in class as well as the various resources you have use online. Use loops, functions, variables, if/else factoring, etc. to ensure that your code is not redundant. Another focus on this assignment is commenting. HTML and CSS are simple declarative languages; in PHP you are implementing complex algorithms. You should have much more commenting in your PHP than we have expected so far. Put a descriptive header (name, course, description of assignment, etc.) at the top of your code, and a well-written comment on each major section of code and function explaining in detail what that code is doing. For better code, you should reduce the number of large complex chunks of PHP code that are injected into the middle of your HTML code. When possible, try to replace such chunks with functions that are called in the HTML and declared at the bottom of your file. Also, you should minimize the use of print and echo statements. As much as possible you should insert dynamic content into the page using PHP expression blocks as.

CSS is not a major part of this assignment, but you should not introduce new poorly written CSS code. If possible, do not express stylistic information in HTML, such as inline styles or presentational HTML tags.

*Again, in this assignment, feel free to show your hard work and creativity and you are welcome to use your own code, design, styles and images in creating your own web page!* Development Strategy and Hints: - PHP code is difficult to debug if you have lots of errors on your page. It is wise to write this program incrementally, adding small pieces of code to a known working page, and not advancing until you have tested and debugged the new code. Rather than trying to generalize all of your page at once, focus on incorporating a particular aspect or input file. Once this is successful, move on to the next. - We suggest that get your page to display a single film (such as princessbride or seabeast) first, then generalize it for other films. None of your code should refer to specific names of films such as princessbride. - Since this program uses PHP code, you will need to upload your files to the web to test your work. Changes you make to your files will not be shown in the browser until you reupload the file and refresh. - The following PHP functions may be helpful to you in implementing this program:

  • count - returns the number of elements in an array
  • explode - breaks apart a string into an array of smaller strings based on a delimiter
  • file - reads the lines of a file and returns them as an array
  • glob - given a file path or wildcard such as foo/bar*.jpg, returns an array of matching file names
  • list - unpacks an array into a set of variables; useful for dealing with fixed-size arrays of data
  • trim - removes whitespace at the start/end of a string (gets rid of stray spaces in output)

Turn-in Please create a zip file with the name following this convention: uanetid_hw3.zip. This zip file should contain all the files you generated as part of this assignment. Once constructed, submit this zip file to the Assignments folder Assignment 3 at D2L site. You still need to turn in your movie.css even if it did not change from HW2. Additionally, please post your work to your password-protected web space within your U-System account and submit the URL within your D2L dropbox submission notes. In addition to the URL, please also provide me the password for user carlcanlas to access your protected web folder in your submission note. Rubric This assignment is worth a total of 100 points. I will check the below components when grading your work: ? (30 points) Web Appearance ? (50 points) Dynamic page content ? (20 points) Coding style Again, even if your web folder is not protected, you need at least to upload your files into your U web space. And provide me an URL to access your web page(s) and grade. I will not grade your submission without the URL attached. If your folder is protected, please provide me the password for user carlcanlas to access your protected web folder in your submission note attached with your submission work in the D2L dropbox.

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 Programming Questions!