Server Side Versus Client Side

Channels >> Webmasters >> Server Side Versus Client Side
Server Side Versus Client Side
Posted by Tiff (#1) on 13 May 2012, 1:07 PM EDT in Programming Guides
In general, the functioning of a website can be divided into client side and server side operations. When you program and code a website, it's important to understand the difference between server side and client side operations because it'll allow you to make smarter decisions about the way you code your website.

Server Side Languages


Examples: PHP, ASP, CGI, Ruby on Rails

Simply put server side languages are those which are processed by the server rather than the browser. For you as a programmer and web developer, there are some functionally significant things about server side languages you should remember:

  1. Server side languages are processed before a page is loaded. That means you can't use PHP alone to change the HTML or text of a page without reloading the page.

  2. You can't view the source code of a Server Side languages using a browser's "View Source" feature. That's because server side code isn't actually sent to the browser.

  3. Browsers do not understand server side languages. That's why if you try to test a PHP file on your computer without having a local development environment installed, it won't work properly.

  4. Since server side languages are not processed by the browser, you don't have to worry about browser compatibility with them at all.

  5. Unless you tell a server side script to output HTML or text, the browser isn't actually going to see anything. In PHP, for example, the echo and print functions are used to show HTML.


Client Side Languages


Examples: HTML, CSS, Javascript, VBScript

Client side languages are languages which are processed by the browser. Client side scripting languages such as Javascript are usually used to create effects on the user end such as drop down menus, image slideshows, tabs, and other things of a similar vein. Once again, some key functional differences you should remember are:

  1. Client side languages are responsible for the visual appearance and functioning of a single page after it has been loaded.

  2. You can view the source code of client side languages because the code is directly sent to your browser to be interpreted. This also means you can test client side scripts with only a web browser.

  3. Client side code is "hackable." Since the code is run by the user's browser, the user can change the functioning of the code, either by editing the code or their browser. That means that client side scripts should not be depended upon for security features such as restricting types of user inputs.

  4. Client side functions are affected by the browser and operating system that a user uses. That means you should test client side code in a variety of browsers to make sure it works properly.


Interaction of Server and Client Side


In recent years, techniques such as AJAX have been adopted in order to allow the interaction of client side and server side languages to create more robust content. The basic idea behind AJAX is that a client side language such as Javascript is used to send input to a page which runs a server side script and generates an output that the client side script then uses to change something on the page the user is viewing.

Effectively, this means that AJAX can be used to let users complete functions usually handed to server side languages such as posting comments or loading more content from a database onto a page without having to reload a whole page or load a new page.
Navigation
© 2017 PokeDS. Pokémon © 1995-2017 Nintendo/ Pokémon. Icons © LED24.
Page generated in 0.0732 seconds.
AboutContactLinkTermsPrivacyHelp
Silver Islands Indigo Plateau The Cave of Dragonflies Clash at the Summit