11.12.07

Running ASP Scripts on your Computer

Posted in ASP Scripts at 7:48 am by admin

ASP is the Microsoft version of PHP and indeed can be a very useful language to use in your coding, especially if you happen to be a big fan of Microsoft FrontPage.  However, you can not just go ahead and use ASP right away without making some medications to your computer, unless you own an external server that you can use.  If you are like most people, an external server is not particularly high on your priority purchase list and therefore you need to use a Personal Web Server (PWS) on your computer in order to take the place of the normal server that other people would use.

The PWS is a product that is made by Microsoft and it is specifically for people that are interested in running ASP scripts on their computer without having to invest in a server in order to do so.  Installing the PWS requires at least Windows 98, Second Edition, if you are truly serious about learning ASP and preferably if you had something even more recent than that such as Windows 2000 then the situation would be much better.  If PWS is not a good choice for you, then you can also look into IIS (Internet Information Services) as an independent choice for you to install on your computer that is capable of running ASP scripts.

Installation of PWS is different depending on the system that you have in place.  PWS is not shipped with any copies of Windows 95, so if you have that operating system then you need to download the Windows NT 4.0 Option Pack in order to get the PWS that you need to install on your computer.  Once you have those downloaded (in all other cases you get the PWS files already shipped), then you can go ahead and follow the installation instructions that come with it in order to get the server set up on your computer.  The same is also true for IIS.

Once you have the server installed, try running the following code in the local directory:

<html>
<body>
<%
Response.write(“Hello World”)
%>
</body>
</html>

If you get the following:

Hello World

On the screen, then it means ASP is working fine.  If you get nothing in the screen, then you have done something wrong within the installation procedure.  Go back and look at what you have done to see if there is a part of the installation procedure that you failed to observe.

Scriptycan is a great software repository featuring both free and commercial ASP scripts and applications for developers and programmers.

11.05.07

The World’s Simplest ASP Script

Posted in ASP Scripts at 7:03 am by admin

ASP is a language that is very similar to PHP, the only difference being that PHP is more of an open source deal, while ASP is a proprietary language that is owned by Microsoft. This is why you will find a lot more Microsoft products supporting ASP languages and allowing you to shortcut through ASP languages, because of course the company is simply attempting to protect and even promote its own language. If you already have a working language of PHP, then you are likely to be able to assimilate ASP pretty quickly as well.

In order to help you do that, let us do what we have done for countless other programming languages; create the simplest script imaginable and then use it to explain the basics of the specific language in question. Before we do this though, we have to introduce you to the basic syntax rule when it comes to ASP. ASP files contain a combination of HTML tags, delineated by <> and , but they also contain ASP scripts, which are delineated by <% and %>. These scripts, like PHP scripts, are executed on servers and return results in HTML code based on what the scripts are designed for.

So, without further ado, here it is; the world’s simplest ASP script:

<%
response.write(“Hello World!”)
%>

There you have it; about as simple as anything can get. If you have already dealt with learning other languages, then you are already undoubtedly aware of the significance of the Hello World example. In this simple ASP script, the words Hello World will appear on screen followed by an exclamation point.

The parts of the script are quite simple, yet also quite effective in allowing us to examine the script more closely. The <% and %> lines are for starting and ending the ASP script and indeed are only on different lines in order to accentuate their presence as well as maintain the standard formatting for different lines of code (i.e. having the starting and stopping parts of the code occupy their own lines in simpler coding structures).

The response.write aspect of the script is the same as the echo or the _e parts of the PHP script in that they simply return a value that is put into the quotations inside the conventional brackets and in the case of this specific script that value happens to be Hello World! These are the basics of how ASP scripts work.

Scriptycan is a great software repository featuring both free and commercial ASP scripts and applications for developers and programmers.