Server-Side Scripting/Requests

From Wikiversity
Jump to navigation Jump to search

This lesson introduces HTTP GET and HTTP POST request processing.

Objectives and Skills[edit | edit source]

Objectives and skills for this lesson include:

  • Understand HTTP GET and POST requests
  • Understand query strings
  • Create server-side HTML forms
  • Process HTTP GET and POST requests

Readings[edit | edit source]

  1. Wikipedia: Hypertext Transfer Protocol
  2. Wikipedia: Query string
  3. Wikipedia: Form (HTML)

Multimedia[edit | edit source]

Additional items may be contributed by course participants

  1. YouTube: Handling HTTP Requests with Express JS
  2. YouTube: Handling HTTP Requests with Express JS
  3. YouTube: Using Go for a simple HTTP Request
  4. YouTube: PHP Get & Post Tutorial
  5. YouTube: Flask Tutorial #4 - HTTP Methods (GET/POST) & Retrieving Form Data

Examples[edit | edit source]

Activities[edit | edit source]

Complete the following activities using HTML, CSS, and a server-side scripting language. Apply best practices for user interface design and your selected scripting language, including comments, indentations, naming conventions, and constants. Use HTML forms and input elements for input, server-side scripts for processing, and HTML elements for output. Create test data to validate the accuracy of each program. Add comments at the top of the program and include references to any resources used.

HTML[edit | edit source]

  1. Review MathsIsFun: Measurement Index. Create a unit conversion calculator for either length, volume, or weight. For the given type of conversion, include at least three units to covert from and to. For example, length might convert from/to yards, feet, and inches or kilometers, meters, and centimeters, etc. See Calculator.net: Conversion Calculator for an advanced example of how the user interface could be designed. Include a Convert button that submits the form to the server-side script for processing.
  2. Review MathsIsFun: Area of Plane Shapes. Create an area calculator. Include at least three different shapes to calculate the area for. See Calculator.net: Area Calculator for an advanced example of how the user interface could be designed. Include Calculate buttons that submit the form to the server-side script for processing.

HTML and CSS[edit | edit source]

  1. Review Wikipedia: Body mass index and MathsIsFun: Metric - US/Imperial Conversion Charts. Create a BMI calculator. Allow the user to enter their height and weight in either US or metric units. Display the full BMI scale using a format of your choice and highlight the user's place on the scale with your choice of CSS formatting (background color, border, color, font style, font weight, etc.). See Calculator.net: BMI Calculator for an advanced example of how the user interface could be designed. Include a Calculate button that submits the form to the server-side script for processing.
  2. Review UMN: Saffir-Simpson and Fujita Scale. Create a wind speed categorization program. Allow the user to enter a wind speed and select either hurricane or tornado. Display the corresponding wind scale and highlight the user's entry on the scale using your choice of CSS formatting (background color, border, color, font style, font weight, etc.). Include a Display button that submits the form to the server-side script for processing.

Lesson Summary[edit | edit source]

Additional items may be contributed by course participants

Key Terms[edit | edit source]

Additional items may be contributed by course participants

See Also[edit | edit source]

References[edit | edit source]