Example of using the Server Object
View the source code

Using Server.CreateObject :

ERROR!
Creating the Unknown object gave the following error : 006~ASP 0177~Server.CreateObject Failed~800401f3
Error number = -2147221005, Error source = Server object

Transaction processing is not currently supported

Server Execute is not currently supported :

Server.GetLastError is not currently supported :

Using Server.HTMLEncode :
Here is some bold text
Here is some <B>bold text</B>

Using Server.MapPath :
h:\root\home\phdccltd-001\www\phdccUK\Dynamic-CD\dcddoc\biodoc\servTst.asp

Because the path parameters in the following examples do not start with a slash character, they are mapped relative to the current directory :
h:\root\home\phdccltd-001\www\phdccUK\Dynamic-CD\dcddoc\biodoc\data.txt
h:\root\home\phdccltd-001\www\phdccUK\Dynamic-CD\dcddoc\biodoc\script\data.txt

The next two examples use the slash characters to specify that the path returned should be looked up as complete virtual paths on the server :
h:\root\home\phdccltd-001\www\phdccUK\script\data.txt
h:\root\home\phdccltd-001\www\phdccUK\script

The following examples demonstrate how you can use either a forward slash (/) or a backslash (\) to return the physical path to the home directory of the Web site root :
h:\root\home\phdccltd-001\www\phdccUK
h:\root\home\phdccltd-001\www\phdccUK

The following examples demonstrate how you can use relative pathing to return the relative physical path to the page that is being viewed in the web browser :
h:\root\home\phdccltd-001\www\phdccUK\Dynamic-CD\dcddoc
h:\root\home\phdccltd-001\www\phdccUK\Dynamic-CD\dcddoc

The Server.Transfer method currently is equivalent to Response.Redirect and so in the following script, the output text "I am going to ASP2" would be lost :
I am going to ASP2

Using Server.URLEncode :
http%3A%2F%2Fwww%2Ephdcc%2Ecom