Skip to content

Server-Side and Client-Side Processing

1.3.4 Web technologies · Paper 1 · 2 flashcards · 4 questions

Web applications divide work between the server and the client (browser).

Client-Side Processing

Definition
Client-side processing occurs in the user's browser. JavaScript is the primary client-side language.
Key Point
Client-Side Characteristics:
• Code runs in the browser
• Source code visible to users
• No server communication needed for execution
• Instant feedback (no network delay)
• Limited by user's device capabilities

Best For:
• Form validation
• UI interactions (dropdowns, animations)
• Real-time updates
• Reducing server load

Server-Side Processing

Definition
Server-side processing occurs on the web server before the page is sent to the client. Languages include PHP, Python, Java, Node.js.
Key Point
Server-Side Characteristics:
• Code runs on server, hidden from users
• Can access databases securely
• Independent of client browser/device
• Requires network communication
• Server handles processing load

Best For:
• Database operations
• User authentication
• Payment processing
• Generating dynamic content
• Security-sensitive operations
Worked Example
Worked Example: Login Form Processing

Client-side (JavaScript)
javascript
function validateForm() {
  if (username == "" || password == "") {
    alert("Please fill in all fields");
    return false; // Prevent submission
  }
  return true; // Allow submission
}
Quick feedback, but not secure on its own (can be bypassed).

Server-side (e.g. PHP)
php
$username = $_POST['username'];
$password = $_POST['password'];

$result = checkCredentials($username, $password);

if ($result) {
  startSession($username);
} else {
  echo "Invalid credentials";
}
Server validation is authoritative and cannot be bypassed from browser code.

Comparison

Key Point
Runs On
• Client-Side: User's browser
• Server-Side: Web server

Languages
• Client-Side: JavaScript, HTML, CSS
• Server-Side: PHP, Python, Node.js, Java

Visibility
• Client-Side: Code visible to user
• Server-Side: Code hidden from user

Database Access
• Client-Side: No direct access
• Server-Side: Full access

Security
• Client-Side: Less secure
• Server-Side: More secure

Speed
• Client-Side: Instant (no network)
• Server-Side: Network delay

Best For
• Client-Side: UI, validation, interactivity
• Server-Side: Business logic, data, security
Exam Tip
In Practice:
Modern web applications use BOTH:
• Client-side for responsive UI and instant feedback
• Server-side for security, data, and business logic
This is called a "full-stack" approach.