UK WEB HOSTING FORUM FOR DISCUSSION ON WEB HOSTING SERVICE AND SUPPORT
LINUX HOSTING WINDOWS HOSTING PACKAGES SHOPPING CART OSCOMMERCE ZEN CART AGORA
ECOMMERCE HOSTING ASP MSSQL FRONTPAGE HOSTING PHP MYSQL HOSTING DISCUSSION FORUM
CPANEL RESELLER HOSTING DEDICATED SERVER VPS HOSTING PLESK VIRTUOZZO
Quick Search
Your forum announcement here!

  UK Web Hosting | Dedicated Server Windows and Linux VPS Forum > Technical Support > Tutorials / How to?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 26-07-2007, 15:32
Ben Ben is offline
Premium Member
 
Join Date: Jan 2007
Location: setcookie()
Posts: 890
Send a message via AIM to Ben Send a message via MSN to Ben Send a message via Yahoo to Ben
Default Basics of ASP

Amongst the others, ASP is my favourite programming language, and it was easiest for me to learn. Now I think its time to pass on my knowledge .

ASP stands for Active Server Pages. It is a programming language made by Microsoft. Note: ASP is only available on Windows platforms. For documentations on how to install IIS Web Server, etc. please go to www.microsoft.com, or if you have chosen a Web host, and they have got ASP successfully installed, then it's time to get coding! The default file will usually be default.extension. Remember: ASP has an extension .asp

Firstly, ASP is basically VBScript, because VBScript is the default language for ASP, I recommend you just stick to VBScript when coding with ASP, for the benefit of understanding this tutorial.

Okay, make a document file named default.asp. And add the following lines:

Code:
<%
response.write("This is my web page!")
%>
The response.write is like the echo() function in PHP, it outputs strings, variables, etc. to a web page. Simply, you should have This is my web page! on the page. Simple huh?

Next; Variables. Variables store information. For instance, variables themself, strings, numbers, etc. Here's an example:

Code:
<%
'This is a variable outputting a number, numbers DO NOT get quoted around.
dim x
x=1
'The response.write is outputting a variable, without quotation marks.
response.write(x)
'You can put a comma to declare many variables. Then we have chosen the variable y to have a value of 'Hello', then we asked the z variable to hold data of the y variable. Afterwhich, the z variable was outputted.
dim y, z
y="Hello!"
z=y
response.write(z)
%>
Remember: Variables can only start with A-Z or a-z and cannot contain periods.

Next; Select.

Code:
<%
dim x
x=1
Select Case x
Case 1
response.write("This is the correct case")
'This is incase all cases are false
Case Else
response.write("Case 1 is correct, so no need for me then :(")
End Select
%>
Next; Concatenation Operator

Code:
<%
dim x
x="Hello"
dim y
y="World!"
response.write(x & y)
%>
Next; IF statements. You can have logical operators: And, Or, Not. Also, you can have = equal to, <> not equal to, < less than and > more than. PHP has incrememt and decrement operators, ASP doesn't.

Code:
<%
dim x
x=1
dim y
y=1
If x = y Then
response.write("That is correct")
End If
%>
<%
dim zz
zz=2
dim aa
aa=5
If zz = yy Then
response.write("Huh? I thought the variables aren't the same?")
Else
response.write("I thought so. The variables are NOT the same!")
End If
%>
You can also add ElseIf, simply instead of putting Else add If to the end, then afterwhich add Else then End If. To do And, Or logical operators, you simply do virtually the same thing:

Code:
If zz And yy = 2 Then
And so on...

However, to do the Not logical operator, you add Not just after the If, for example:

Code:
If Not zz = yy
How about making sure a math sum is correct? :P

Code:
<%
If 5 + 5 = 10 Then
response.write("That's absolutely correct!")
Else
response.write("Umm..WRONG!")
End If
%>
You can also use many other operators such as - (subtraction), * (multiplication), / (division). You can also use other operators, but they are less needed, so I don't really think they are needed here in the tutorial.

Next; Arrays. Arrays are basically like the same variables used over and over again for different values.

Code:
<%
dim someArray(2)
'The first array is (0)
someArray(0) = "Hannah"
someArray(1) = "Fredrick"
someArray(2) = "Thomson"
response.write(someArray(0))
%>
<%
'Here is another neat trick:
dim somecoolarray()
'The Redim is to basically, once you have decided, to assign an integar to the array. The Redim can be used as many times as you want. The Preserve is to make sure the previous arrays before you Re declared the array to display for example when you use the response.write to output the arrays.
Redim somecoolarray(1)
somecoolarray(0) = "Robert"
somecoolarray(1) = "Ingrid"
Redim Preserve somecoolarray(2)
somecoolarray(2) = "Anna"
%>
That's it for now! I added this tutorial to basically help me remember ASP myself! Hope you enjoy it!

I made this tutorial with extreme backache (lol), so no copying or re-distributing!
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.



To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
-
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
-
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.



To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.



To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.



To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Reply With Quote
  #2 (permalink)  
Old 26-07-2007, 22:39
System Administrator
 
Join Date: Dec 2006
Location: localhost
Posts: 682
Cool

Wow Ben, I appreciate the efforts you have taken to write down these beautiful scripts. I am sure this'll help a lot of people all over the world.
__________________

Rock _a.k.a._ Jack L.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
||
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Reply With Quote
  #3 (permalink)  
Old 26-07-2007, 22:51
flesso's Avatar
Premium Member
 
Join Date: Mar 2007
Location: 127.0.0.1
Posts: 1,350
Default

Well done Ben!

You've done a great job there, and you seem to be coming along well with ASP!

You deserve a mention in the congrats thread.
__________________
Regards,
Josh Hold


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Over 1000 Computer Related Articles to Sink Your Teeth Into!



To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
- Gig Listings for London


Super Moderator
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


I'm only a forum gremlin (moderator), and do not work for eUKhost in any way. Opinions expressed by me are mine only, and do not reflect those of either eUKhost or any company that may be listed above.

I don't bite, honest.
Reply With Quote
  #4 (permalink)  
Old 27-07-2007, 08:05
Ben Ben is offline
Premium Member
 
Join Date: Jan 2007
Location: setcookie()
Posts: 890
Send a message via AIM to Ben Send a message via MSN to Ben Send a message via Yahoo to Ben
Default

Thank you for your nice comments! I appreciate it. Glad you like the tutorial.

Quote:
Originally Posted by flesso
and you seem to be coming along well with ASP!
Seemingly so and ASP is so powerful .
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.



To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
-
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
-
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.



To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.



To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.



To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Reply With Quote
  #5 (permalink)  
Old 27-07-2007, 12:39
DPS Computing's Avatar
Premium Member
 
Join Date: Apr 2007
Location: Manchester, United Kingdom
Posts: 4,951
Send a message via ICQ to DPS Computing Send a message via AIM to DPS Computing Send a message via MSN to DPS Computing Send a message via Yahoo to DPS Computing Send a message via Skype™ to DPS Computing
Default

Great tutorial Ben! Pity I am on Linux
__________________
David Smith
DPS Computing

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
- New site / new polls / new stories! With many more to follow!
NEW LAUNCH!
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

NEW LAUNCH!
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 00:32.

 

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by Web Hosting 3.1.0
Copyright © 2001-2008, eUKhost.com. All rights reserved.

 
Site Map

VPS Hosting
VPS Hosting plans

Dedicated Server Hosting
Dedicated Server plans

Business Web Hosting
100% uptime Hosting

Cpanel Hosting
cPanel Shared Hosting

Reseller Hosting
Reseller Web Hosting

Windows Hosting
Windows Shared Hosting

Windows VPS

Windows VPS Hosting

Semi Dedicated Servers
Semi-Dedicated Hosting

Dedicated Server Mirroring
Dedicated Server Mirroring

Webhosting Knowledgebase
Frequently asked Questions

Web Hosting Blog
eUKhost Blog

Web Hosting Support
Support Helpdesk

UK Data Center
eUKhost Datacenter

Web Hosting Forum
eUKhost Forum

Support Tutorials
Online Flash Tutorials

Offsite Back-up Plans
Remote Backup Service

Customer Testimonials
eUK Customer Testimonials


knowledgebase articles

eUKhost.com Services

Pre-Sales Questions
Pre-sales FAQ's

Domain Names
Domain registration FAQ's

cPanel Hosting
cPanel Hosting FAQ's

Windows Web Hosting
Plesk Control Panel

Reseller Hosting
Reseller Hosting FAQ's

VPS Hosting
Virtual Private Server

Semi-Dedicated Servers
Semi-Dedicated FAQ's

Dedicated Servers
Dedicated Server Hosting


popular blog categories


Web Hosting
Website Hosting articles

UK Web Hosting
UK Hosting articles

Dedicated Server Hosting
Dedicated Server guidelines

VPS Hosting
VPS hosting articles

cPanel Hosting
cPanel Hosting articles

Linux Operating System
Linux Operating techniques

Windows Web Hosting
Windows plesk articles