October 01, 2008

Difference between client-side and server-side scripting


Take the two scripting languages and try to compare between them
Java Script - client-side scripting
PHP - server-side scripting

The difference between these scripts is JavaScript is interpreted by the web browser once the page that contains the script+html has been downloaded. Whereas server-side scripting languages are interpreted by the web server before the page is even sent to the browser. And once it's interpreted, the results of the script replace the server-side scripting language code in the web page itself. i.e., only the output of the script is placed and sent to the web browser and all the browser sees is a standard HTML file.The script is processed entirely by the server, hence the designation: server-side language.

These server-side scripts when executed allow the web developers to control what appears in the browser window more flexibly than what standard HTML do.