BIT251 ยท 2081 ยท 5 marks
What is a web page? How static web sites are different from dynamic web sites. [1+4]
What is a web page? How static web sites are different from dynamic web sites. [1+4]
Quick answer
A web page is a document written in HTML (HyperText Markup Language) that can be displayed in a web browser. It may contain text, images, videos, hyperlinks, and other multimedia elements. Web pages are accessed over the internet using a URL (Uniform Resource Locator) and are hosted on web servers.
Web Page, Static vs Dynamic Websites
What is a Web Page? [1 Mark]
Static vs Dynamic Websites [4 Marks]
Static Website
A static website is one where web pages are pre-built and stored on the server as fixed HTML files. Every user who visits the page receives the same content, regardless of who they are or when they visit. The content does not change unless the developer manually edits the HTML file.
Characteristics:
- Built using only HTML, CSS, and sometimes JavaScript (client-side)
- No interaction with a database
- Fast to load and easy to host
- Suitable for simple, informational websites (e.g., a personal portfolio)
Dynamic Website
A dynamic website is one where web pages are generated on the fly by the server in response to a user's request. The content can change based on user input, time, location, or data stored in a database.
Characteristics:
- Built using server-side technologies such as PHP, ASP.NET, Node.js, Python (Django/Flask), etc.
- Interacts with a database (e.g., MySQL, MongoDB) to fetch or store data
- Content is personalized and changes for different users or conditions
- Suitable for complex applications (e.g., e-commerce sites, social media, online banking)
Comparison Table
| Feature | Static Website | Dynamic Website |
|---|---|---|
| Content | Fixed, same for all users | Changes based on user/request |
| Technology | HTML, CSS | HTML + Server-side scripting (PHP, etc.) |
| Database | Not required | Required |
| Speed | Faster | Relatively slower |
| Maintenance | Difficult (manual editing) | Easier (content managed via CMS/DB) |
| Cost | Low | Higher |
| Example | Personal portfolio, brochure site | Facebook, Amazon, Gmail |
In summary, static websites deliver the same pre-stored content to every visitor, while dynamic websites generate content dynamically based on user interaction and database queries, making them more flexible and interactive.
Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.