What exactly is custom scripting?
As most people are aware the computer language that forms the basis of web pages is HTML. But you’ll often hear mention of scripting languages - so what is a scripting language? First the word scripting just means programming and the term scripting languages tends to be applied to what would actually be called programming languages in a context other than the web.
So is HTML a scripting (or programming) language? Well no - HTML is a mark-up language that consists of a list of instructions that tell the web browser how to render the page (when to break to a new line, which font to use etc). The instructions are generally processed in the order in which they appear in the list and will produce the same result each time the page is loaded. A scripting language, on the other hand, is a list of instructions that may not be processed in the order in which they appear and can make decision branches to other instructions in the list depending on the results of conditional statements. Therefore a script may not produce the same result each time the page is loaded and this is what makes scripting so powerful since it can produce different page content depending on how a user interacts with the website.
Client Side Scripting and Server Side Scripting Scripts can be divided into these two categories and the difference is that a client side script runs in the web browser (this is the client side) after the page is downloaded and a server side script runs on the web server (this is the server side) before the page is downloaded. There are different client side and server side scripting languages but the two most common are JavaScript (that runs client side) and PHP (that runs server side). JavaScript can actually be run server side but it’s not that common and is normally considered as a client side language. Note that HTML, JavaScript and PHP are all actually written as simple text files but saved with different file extensions to allow the browser or web server to differentiate between them.
How Web Pages are ServedTo better understand how scripts run a quick look at how web pages are served up to the browser will help. If you click on a link in a web page or email or you type in a web address into your browser address bar your web browser constructs a request that contains the information in the link or address you typed in. The request holds a lot of information but the two pieces we’re interested in are the name of the resource requested and where the resource is located. A resource is actually a file held on a remote server and may be an HTML page, a server side script, a graphic, a Flash movie or any of the other files types commonly used on the web. Where the resource is located is the name of the remote server - usually a web address that is actually an alias for a unique machine number. When your ISP receives the request it looks up the domain name and converts it to its machine number (if it exists) and passes it on until it finally reaches the required web server. The web server “listens” on one of its ports for requests and when it receives one it processes it. It checks to see if it has a copy of the requested resource and if it doesn’t it returns a not found error (a 404 error) to the sender of the request. If it does have the resource and it’s an HTML file or any other type of resource that requires it to take no further action, it returns a copy of it to the sender of the request whereupon the web browser reads the file and renders the page according to the instructions contained in the file.
