Part 1 - Introducing ASP
For any webmaster, once you have created a page with graphics and content, the next logical step is to make it interactive. You can, of course, go to one of the remotely hosted scripting sites who will provide you with a simple piece of code to put on your site, but there is a lot more flexibility if you can create and install your own scripts which will do exactly what you want.
What Is ASP?
ASP stands for Active Server Pages. It is basically a server-side scripting language designed for the Windows Platform, although it is available on Unix/Linux systems through new systems, although PHP is the more popular choice for this platform. Active Server Pages is based around VBScript, a variant of Visual Basic, which makes it very easy to use as the majority of the commands are plain English and simple to decipher.
What Do I Need?
ASP is a server-side language, so you will need to make sure that your web server has the correct software for running it. The most common setup for running ASP scripts is on a Windows-based server running IIS (Internet Information Server). It is possible to use Linux-based systems, though, but they must have the Chillisoft ASP package installed. Most web hosts will publish whether they support ASP, but if in doubt contact your systems administrator. If you need a free web host supporting ASP, try visiting Free-Webhosting.info.
Once you have the server ready to accept scripts, running one is as easy as simply uploading and running the file. You don't need to put it in any particular place on the server or change any settings. Just upload and run.
When writing ASP you don't need to worry about changing all your HTML, you simply add ASP code into your HTML pages where needed. YOu also don't need any special software on your computer, a simple text editor will do. To begin an ASP page you will first need to tell it what language you have written it in. The most common (and the one used in this tutorial) is VBScript. You should begin your page with:
<%@ Language=VBScript %>
All this code does is tell the ASP system that you are writing your page in VBScript. You will notice that the ASP code is enclosed in special tags. All ASP code should be enclosed in the 'percent sign tags' in the form:
<% ASP Code Here %>
Code can be written over multiple lines, but any code not enclosed in the ASP tags will simply be treated as HTML. Similarly and HTML inside these tags but not specifically sent as output by the code will cause an error.
Before you start writing scripts it is a good idea to test whether ASP will run correctly on your server. Make a simple page with the following:
This is some HTML. Below this I have ASP<br>
<%@ Language=VBScript %><br>
Nothing should appear above here.
and save it as test.asp. Then upload this to your server and access it with your browser. If it has worked correctly, the page should display and you should only see the lines:
This is some HTML. Below this I have ASP
Nothing should appear above here.
If the ASP appears in the page or the source of the page, something has gone wrong. Check the code and also the settings on your server. No ASP should appear as it should have been processed by the server before it was sent to the browser.
In part 2 I will go into more depth about how to use ASP and explain about sending output to the user, variables and some other commands you can use.
1999 - 2001 David Gowans