RK Ravinder Khurana

Web Development

Server-Side Scripting: Meaning, Languages List, Examples and Diagram

· 5 min read

In short: server-side scripting means code that runs on the web server, not in the visitor's browser. When someone opens a page, the server runs a script (in PHP, Python, JavaScript on Node.js, Java or C#), reads or saves data, and sends back finished HTML. The visitor never sees the code, only the result.

Server-side scripting diagram: the browser sends a request, the server runs a script that reads the database, and sends back HTML
How a request becomes a page: the script runs on the server, and only the result travels back.

Server-side script, server-side language, server-side programming: what is the difference?

In everyday use they mean the same idea seen from three angles. A server-side script is one file or program that runs on the server, such as login.php. A server-side scripting language is the language it is written in, such as PHP or Python. Server-side programming is the wider job: writing all the code that runs on the server, including databases, APIs and background tasks. People once kept "scripting" for languages that run without a separate compile step, but that line has mostly faded.

How server-side scripting works, step by step

  1. The visitor's browser asks for a page, for example /orders?id=42.
  2. The web server passes the request to a script.
  3. The script checks who is asking, reads the order from the database, and applies your business rules.
  4. It builds the HTML (or JSON for an app) and sends it back.
  5. The browser shows the result. The script, passwords and database stay on the server.

Server-side vs client-side scripting

Server-sideClient-side
Runs onThe web serverThe visitor's browser
LanguagesPHP, Python, JavaScript (Node.js), Java, C# (ASP.NET), RubyJavaScript
Can see the code?No, only the outputYes, anyone can view it
Good forLogins, payments, databases, secrets, emailsMenus, animations, instant form checks
Works without JavaScript?YesNo

Most real sites use both: the server does the trusted work, the browser makes it pleasant to use.

Server-side scripting examples from everyday sites

  • Logging in. The server checks your password against the stored hash and starts a session.
  • A shopping cart total. Prices, discounts and tax are worked out on the server, so nobody can change them in the browser.
  • A contact form. The server checks the fields, saves the message and sends the email.
  • Search results. The server queries the database and returns only the matching rows.
  • A mobile app. The app calls a server-side API, which returns JSON instead of a web page.
  • Reports and dashboards. The server collects the numbers, so the browser only draws them.

List of server-side scripting languages

LanguageCommon frameworksTypical use
PHPLaravel, Symfony, CakePHP, WordPressBusiness sites, content sites, online shops; hosting is cheap and everywhere
JavaScript / TypeScript (Node.js)Express, Next.js, NestJSReal-time apps, APIs, one language for browser and server
PythonDjango, Flask, FastAPIData-heavy sites, AI features, internal tools
JavaSpring Boot, Jakarta EEBanks, large companies, long-lived systems
C#ASP.NET CoreCompanies on Microsoft technology
RubyRuby on RailsStart-ups that want to build quickly
GoStandard library, GinFast APIs and network services
Classic ASP (VBScript) and Perl (CGI)NoneOlder systems still running; rarely chosen for new work

SQL is not on this list. It is the language for asking a database for data, and a server-side script usually sends SQL to the database on the visitor's behalf.

Examples of server-side scripts

PHP

<?php
$name = htmlspecialchars($_GET['name'] ?? 'friend');
echo "<p>Hello, $name</p>";
?>

JavaScript on Node.js

import http from 'node:http';
http.createServer((req, res) => {
  res.end('<p>Hello from the server</p>');
}).listen(3000);

Python (Flask)

from flask import Flask
app = Flask(__name__)

@app.get('/')
def home():
    return '<p>Hello from Python</p>'

Java (Spring Boot)

@RestController
class HelloController {
    @GetMapping("/")
    String home() {
        return "<p>Hello from Java</p>";
    }
}

What are ASP server scripts surrounded by?

Answer: the delimiters <% and %>. In classic ASP, everything between them runs on the server before the page is sent, and the visitor only receives the result. The short form <%= ... %> prints a value straight into the page.

<p>Today is <%= Date() %></p>
<%
If Hour(Now()) < 12 Then
  Response.Write("Good morning")
End If
%>

PHP does the same job with <?php and ?>. ASP.NET pages still accept <% %> blocks, and its Razor views use @ instead.

Advantages and disadvantages of server-side scripting

AdvantagesDisadvantages
Code, passwords and business rules stay hidden on the serverEvery request uses server time, so busy sites need caching or more servers
Works on any device, even with JavaScript switched offEach click can mean a round trip to the server, which feels slower than instant browser changes
Can read and write databases, send email and take payments safelyA bug or an unpatched version can expose the whole site, so updates matter
Pages arrive ready to read, which helps search engines and AI assistants understand themNeeds hosting that supports the language, not just plain file hosting

Which server-side scripting language should you use?

  • PHP: runs WordPress and countless business sites; cheap hosting everywhere.
  • JavaScript (Node.js): one language for browser and server; good for real-time apps.
  • Python: clear to read; the natural choice when the site works with data or AI.
  • Java and C#: common in banks and large companies with long-lived systems.

For most small businesses and NGOs the right choice is whichever your team, or your developer, can maintain for years. I have built and kept PHP systems running since 2000; see PHP development if that is what you need.

Keep it safe

  • Never trust what the browser sends. Check and clean every input.
  • Keep passwords and API keys on the server, outside the public folder.
  • Escape output so visitors can't inject code into your pages.
  • Keep the language and frameworks updated.

Need a site or app built, or an old PHP system kept running? See my Web Outsourcing Team.

Questions people ask

What is server-side scripting in simple words?

It is code that runs on the web server to build a page before sending it to the visitor. It can read databases, check logins and keep secrets, and the visitor only sees the finished result.

Is JavaScript a server-side scripting language?

It can be both. In the browser it is client-side. With Node.js it runs on the server, so the same language can power both sides of a website.

What are examples of server-side scripting languages?

PHP, Python, JavaScript on Node.js, Java, C# with ASP.NET, and Ruby are the most common.

Is HTML a server-side language?

No. HTML describes a page's content and structure. A server-side script often produces HTML, but HTML itself does not run on the server.

Is PHP still used?

Yes, widely. WordPress and many business sites run on PHP, and modern PHP frameworks such as Laravel are actively developed.

What are ASP server scripts surrounded by?

The delimiters <% and %>. Code between them runs on the server before the page is sent.

Is SQL a server-side language?

Not in the usual sense. SQL is the language for querying a database. A server-side script in PHP, Python or another language sends the SQL and turns the result into a page.

Can Java be used for server-side programming?

Yes. Java with Spring Boot or Jakarta EE is common for large and long-lived systems, especially in banking and enterprise software.

Keep reading