During the early years of the internet, users were presented with what are called static web pages; basic HTML pages that appear exactly the same for every user. As the internet developed, the need grew for dynamic web pages, which appear differently for individual users, for example, users who log in to a site will see different content depending on their status, preferences or previous activity.
Dynamic pages also allow content to be displayed differently for different devices and they can be updated in real time, such as showing which products are in your shopping basket or the latest score in a football match.
To enable a web page to display dynamic content for different users and devices requires scripting. Scripting is the process whereby the interactive elements of a web page are retrieved from the website’s database or other data stores on the site’s server. There are two types of scripting which can occur: server-side scripting and client side scripting. Server side scripting means the information needed to create the dynamic page is done on the web server before being sent to the user. This is done using scripting languages such as PHP, ASP.NET and Python. Client side scripting means the script is sent to the web browser and the browser uses that script to procure and collate the page’s content on the user’s device.
Advantages of Server-Side Scripting:
√ Server-side scripting languages like PHP can be configured to run CMS applications, like WordPress and Joomla. This allows CMS users to easily create and update content on the web without the need for coding.
√ Server-side scripting often reduces the loading time for web pages which can improve the Google ranking of your site and prevent users leaving because of issues with site speed.
√ As the scripting takes place on the server, the script itself is not sent to the browser, this prevents it being copied, cloned or scrutinised for hacking vulnerabilities.
√ Server-side scripting offers greater protection for user privacy and is the preferred option for e-commerce, membership and social media sites.
Disadvantages of Server-Side Scripting:
√ Scripting puts increased demands on a website’s server. Websites using large applications and with heavy traffic may need to utilise more powerful hosting methods such as dedicated servers or cloud hosting to cope with demand.
√ Server-side scripting requires pages to be refreshed in order to show the dynamic content – you will most often see this when you use server-side scripting to log in to a site. However, developers now use a newer method of exchanging data with a server, called Ajax, and this allows web pages to be updated without the need to reload the entire content.
√ Server-side scripting requires a database in order to store the dynamic data. This is not an issue in itself, but the database will need backing up regularly and will need to be kept secure.
The majority of websites now use dynamic content, much of which is managed using server-side scripting. Without server-side scripting the functionality of the internet as we know it today would just not exist.