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
Where does JavaScript embedded in a normal web page execute?
- In the user's browser
- Only on the database server
- Inside the DNS resolver
- 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.
Which of these languages or technologies typically run on the server?
- PHP
- JSP
- Browser JavaScript
- CSS
- 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: 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.

More CPSA topics in this module
- Web server operation, virtual hosting and proxies
- IIS and Apache and their typical flaws
- Tiered web architectures
- HTTP methods and response codes
- HTTPS, SOAP and security-related headers
- HTML and XML
- Application servers and frameworks
- Server extension interfaces
- Thin and thick web clients, applets and decompilation