Bitzu

CPSA ยท Web servers, architecture and protocols

Server-side and client-side web languages

JSP, ASP, PHP, CGI-based Perl and JavaScript: where each runs and typical weaknesses.

Key points

  • Server-side languages run on the server and return only output.
  • JSP: Java compiled to servlets. Classic ASP: e.g. VBScript on IIS. PHP.
  • Perl via CGI: a separate process per request.
  • Client-side JavaScript: runs in the browser; source visible, validation bypassable.
  • Weaknesses: unsanitised input (injection), unsafe file inclusion or uploads (notably PHP), verbose errors showing paths, trusting client checks.

Practice questions

Single choice

Where does JavaScript embedded in a normal web page execute?

  1. In the user's browser
  2. Only on the database server
  3. Inside the DNS resolver
  4. On the web server before the response is sent
Show answer

Answer: A. In the user's browser

Browser JavaScript runs on the user's machine in the browser. Server-side languages such as PHP or JSP run on the server.

Select all that apply

Which of these languages or technologies typically run on the server?

  1. PHP
  2. JSP
  3. Browser JavaScript
  4. CSS
  5. HTML
Show answer

Answer: A. PHP, B. JSP

PHP and JSP are executed by the server. Browser JavaScript and CSS are processed by the client.

True or false

True or false: a visitor can view the PHP source of a correctly configured page by using the browser's View Source.

Show answer

Answer: False

False. The server executes the PHP and sends only the generated output; the source is exposed only if the server is misconfigured.

Practice 8 questions on this topic in Bitzu

Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.

Download on the App StoreGet it on Google Play

More CPSA topics in this module