Skip to content
Web and HTTP2 min read

What is a dynamic website?

Short answer

A dynamic website generates its pages at the moment they're requested, using code that runs on the server, such as PHP, Node.js or Python, and data from a database. So a page can differ by visitor and by time, as in online shops, forums and WordPress sites.

ArabyHost teamLast updated: ShareWhatsAppXLinkedIn
Contents
  1. The building blocks
  2. A simple PHP example
  3. Dynamic vs static
  4. Common problems
  5. On ArabyHost

When you open a product page in an online shop, there’s no ready-made file for it. The code reads the product ID from the URL, pulls the name and stock level from the database, adds the visitor’s cart, then builds the HTML and sends it. That’s what makes a site dynamic.

The building blocks

Component Examples
A server-side language or runtime PHP, Node.js, Python
A framework or CMS WordPress, WooCommerce, Laravel, Django
A database MySQL, MariaDB, PostgreSQL
A web server LiteSpeed, Nginx, Apache

A simple PHP example

<?php
$pdo = new PDO('mysql:host=localhost;dbname=shop', 'user', 'pass');
$stmt = $pdo->prepare('SELECT name FROM products WHERE id = ?');
$stmt->execute([$_GET['id']]);
echo '<h1>' . htmlspecialchars($stmt->fetchColumn()) . '</h1>';

The example uses a prepared statement to protect against SQL injection, and htmlspecialchars to stop code being injected into the page.

Dynamic vs static

A dynamic site gives you a dashboard for editing content, user accounts, search and orders. In exchange it uses more resources, because every request runs code and hits the database, and it needs ongoing security updates. A static website is simpler and faster but limited.

Common problems

  • Slowing down as traffic grows: the first fix is caching, saving the generated page and sending it to the next visitors without rebuilding it.
  • Error establishing a database connection: wrong connection details, or the database is down.
  • Plugin vulnerabilities: many WordPress compromises come from outdated plugins or themes.

On ArabyHost

ArabyHost hosting plans run dynamic sites on PHP 8.1-8.3 with MySQL/MariaDB databases, plus one-click WordPress and WooCommerce installs. The Developer plans add Node.js 20 and 24 and Python 3.9-3.12 through the CloudLinux selectors, along with SSH, Git and Composer. On WordPress sites, LiteSpeed with LiteSpeed Cache serves cached pages without running PHP on every request, and JetBackup keeps daily backups of your site.

FAQ

Is WordPress a dynamic website?

Yes. WordPress is written in PHP, stores posts and settings in a MySQL or MariaDB database, and builds each page on request unless it's cached.

Which is better, static or dynamic?

It depends on what you need. If content rarely changes and there are no accounts or orders, a static site is simpler. Shops, blogs managed from a dashboard and platforms need a dynamic site.

Why are dynamic sites sometimes slower?

Every request runs code and queries the database before the page is sent. Page caching, OPcache and better queries narrow that gap a lot.

Useful? Share it with someone who needs it:WhatsAppXLinkedIn

Read next

Ready to put your idea online?

Fast, isolated hosting, support that understands you, and an AI assistant that fixes problems with you.