sim web

Upload: simran-chhina

Post on 02-Apr-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/27/2019 sim Web

    1/61

    Practical File

    Of

    Web Designing

    Submitted To: Submitted by:Mrs. Amandeep kaur Simranjit Singh

    Assistant Professor 94972346433

    Punjab College of Technical Education

    1

  • 7/27/2019 sim Web

    2/61

    Contents

    Serial no. Topics Page No.

    1. Introduction to HTML 3

    Applications Of HTML 12

    2 Introduction to DHTML 32

    CSS 33

    Applications of DHTML 34

    3 Introduction to Java Script 44Applications of Java Script 45

    4 Introduction to ASP 52

    Features of ASP 53

    Global.asa file 54

    Variables, Request and Response objects 55

    Database Connectivity 56

    5 Screenshots of PCTE web Site 57

    6 Screenshots of Blog 59

    2

  • 7/27/2019 sim Web

    3/61

    Introduction to HTML

    The purpose of a web browser is to read HTML documents and compose them into

    visible web pages. The browser does not display the HTML tags, but uses the

    tags to interpret the content of the page.

    HTML elements form the building blocks of all websites. HTML allowsimages

    and objectsto be embedded and can be used to create interactive forms. It

    provides a means to create structured documents by denoting

    structural semantics for text such as headings, paragraphs, lists, links,

    quotes and other items. It can embedscriptsin languages such

    as JavaScriptwhich affect the behavior of HTML WebPages. Web browsers can

    also refer to Cascading Style Sheets(CSS) to define the appearance and

    layout of text and other material.

    Features Of HTML

    Lets you embed Perl code into HTML documents. Perl code is evaluated at the server

    side and the result is sent to the browser.

    Offers various meta-commands for conditional and loop processing of the HTMLdocuments.

    Automatically generates dynamic HTML tables/lists from Perl arrays or function calls

    (e.g. DBI fetch)

    Form data send to your document is placed in a hash

    Automatically inserts data from the form hash into HTML input, textarea and select tags

    Understands HTML and URL escaping and unescaping

    Handles per-user and per-module persistent session data for you. All you need to do isstore and retrieve them to and from a special hash.

    3

    http://en.wikipedia.org/wiki/Web_browserhttp://en.wikipedia.org/wiki/Img_(HTML_element)http://en.wikipedia.org/wiki/Img_(HTML_element)http://en.wikipedia.org/wiki/Fieldsethttp://en.wikipedia.org/wiki/Structured_documenthttp://en.wikipedia.org/wiki/Semantichttp://en.wikipedia.org/wiki/Scripting_languagehttp://en.wikipedia.org/wiki/JavaScripthttp://en.wikipedia.org/wiki/Cascading_Style_Sheetshttp://en.wikipedia.org/wiki/Img_(HTML_element)http://en.wikipedia.org/wiki/Img_(HTML_element)http://en.wikipedia.org/wiki/Fieldsethttp://en.wikipedia.org/wiki/Structured_documenthttp://en.wikipedia.org/wiki/Semantichttp://en.wikipedia.org/wiki/Scripting_languagehttp://en.wikipedia.org/wiki/JavaScripthttp://en.wikipedia.org/wiki/Cascading_Style_Sheetshttp://en.wikipedia.org/wiki/Web_browser
  • 7/27/2019 sim Web

    4/61

    Allows you to build your web-site out of components. Frequently used elements can

    be defined once and included in every page.

    Object allows you to define the standard layout of your site just once andincludes the necessary components based on the uri. Your HTML documents

    just have to contain the unique stuff and not the common stuff like

    headers/footers or navigation bars. Also these common elements can beoverwritten in each subdirectory.

    Gives you the possibility to build libraries with a set of frequently used Elements orcomponents, and make them available to the whole web-site in the same way as Perl

    modules are - well, modularized.

    Supports debugging of pages by generating a very detailed log file and making itaccessible via the browser with a single click.

    Generates verbose error pages in which every error can link to the log file. This isideal for debugging.

    Offers a lot of options for maximum configurability according to your personal tastes

    and needs.

    Fully integrated into Apache and mod_perl to acheive the best performance. Can also

    run as a CGI-script, offline or called from another Perl program.

    HTML:Mail gives you the possibility to send the result directly to a email address

    4

  • 7/27/2019 sim Web

    5/61

    HTML Tags

    Tag Name Code Example

  • 7/27/2019 sim Web

    6/61

    form

    Name:
    Email:

    heading 1heading 2heading 3heading 4

    heading 5heading 6

    Heading 1 ExampleHeading 2 ExampleHeading 3 ExampleHeading 4 Example

    Heading 5 ExampleHeading 6 Example

    heading ofHTMLdocument

    Contains elements describing thedocument

    horizontalrule

    horizontalrule

    horizontalrule

    (InternetExplorer)

    horizontalrule

    (Internet

    Explorer)

    horizontal

    rule

    hypertextmarkuplanguage

    Title of your web page

    HTML web page contents

    italic Example

    image

    input field

    Example 1:

    (Internet Explorer)

    input field

    Example 2:

    input field Example 3:

    6

    http://www.web-source.net/216_color_chart.htm.htmhttp://www.web-source.net/216_color_chart.htmhttp://www.web-source.net/216_color_chart.htm.htmhttp://www.web-source.net/216_color_chart.htm
  • 7/27/2019 sim Web

    7/61

    input field

    Example 4:

    Enter Your Comments:

    input field

    Example 5:

    Select an option:option 1option 2

    option 3option 4option 5option 6

    input field

    Example 6:

    Select an option:
    Option 1

    Option 2 Option 3

    Select an option:
    Selection 1Selection 2Selection 3

    list item Example 1:

    List item 1List item 2List item 3

    Example 2:

    7

  • 7/27/2019 sim Web

    8/61

    List item 1List item 2List item 3

    List item 4

    link

    (Internet

    Explorer)

    scrollingtext

    Example

    Marquee

    ordered list Numbered

    List item 1List item 2List item 3

    List item 4

    Numbered Special Start

    List item 1List item 2List item 3List item 4

    Lowercase Letters

    List item 1List item 2

    List item 3List item 4

    Capital Letters

    List item 1List item 2List item 3List item 4

    Capital Letters Special Start

    List item 1List item 2List item 3List item 4

    Lowercase Roman Numerals

    8

    http://www.web-source.net/216_color_chart.htmhttp://www.web-source.net/216_color_chart.htm
  • 7/27/2019 sim Web

    9/61

    List item 1List item 2List item 3List item 4

    Capital Roman Numerals

    List item 1List item 2List item 3List item 4

    Capital Roman Numerals Special Start

    List item 1List item 2

    List item 3List item 4

    listboxoption

    Select an option:option 1option 2option 3option 4

    option 5option 6

    paragraph

    This is an example displaying the use of theparagraph tag.

    This will create a line break and

    a space between lines.

    Attributes:

    Example 1:


    This is an example
    displaying the use
    of the paragraph tag.

    Example 2:


    This is an example
    displaying the use
    of the paragraph tag.

    Example 3:

    This is an example

    displaying the use
    of the paragraph tag.

    9

  • 7/27/2019 sim Web

    10/61

    small (text) Example

    deletedtext

    Example

    strongemphasis

    Example

    table

    Example 1:

    Column 1Column 2

    Example 2: (Internet Explorer)

    Column 1

    Column 2

    Example 3:

    Column 1Column 2

    Row 2Row 2

    table data

    Column 1Column 2

    tableheader

    Column 1Column 2Column 3

    Row 2Row 2Row 2Row 3Row 3Row 3

    10

    http://www.web-source.net/216_color_chart.htmhttp://www.web-source.net/216_color_chart.htmhttp://www.web-source.net/216_color_chart.htmhttp://www.web-source.net/216_color_chart.htmhttp://www.web-source.net/216_color_chart.htmhttp://www.web-source.net/216_color_chart.htm
  • 7/27/2019 sim Web

    11/61

    Row 4Row 4

    Row 4

    documenttitle

    Title of your HTML page

    table row

    Column 1Column 2

    teletype Example

    underline Example

    unordered

    list

    Example 1:

    List item 1List item 2
    Example 2:

    List item 1List item 2List item 3List item 4

    11

  • 7/27/2019 sim Web

    12/61

    ApplicationsOF

    HTML

    12

  • 7/27/2019 sim Web

    13/61

    1. Application To print text in HTML

    Code To implement :

    13

  • 7/27/2019 sim Web

    14/61

    Web

    My First Web Page

    2. Application to display different Kinds of headings in HTML.

    14

  • 7/27/2019 sim Web

    15/61

    Code To implement :

    This is heading 1

    This is heading 2

    This is heading 3

    This is heading 4

    This is heading 5

    This is heading 6

    15

  • 7/27/2019 sim Web

    16/61

    3. Application for creating the Link in Html.

    When we will click on Click here it will show list of subjects.

    16

  • 7/27/2019 sim Web

    17/61

    Code To implement :


    Click here to view List of subjects

    of BCA

    Save this file using any name with .html extension and create new html

    document.

    17

  • 7/27/2019 sim Web

    18/61

    Subjects

    1st Sem

    maths

    c

    communication

    IT

    2nd sem

    Data structure

    microprocessor

    CSA
    3rd Sem

    java

    c++

    OR

    18

  • 7/27/2019 sim Web

    19/61

    4. Application to increase size , change the color , font style of text.

    19

  • 7/27/2019 sim Web

    20/61

    Code To implement :

    This paragraph is in Monotype Corsiva , size 10, and in red text color.

    20

  • 7/27/2019 sim Web

    21/61

    5. Application for creating Table in HTML.

    Code To implement :

    Table

    21

  • 7/27/2019 sim Web

    22/61

    name

    marks

    c

    web designing

    java

    Divam

    1650

    40

    Abc

    16

    50

    40

    Def

    16

    50

    40

    Ghi

    16

    50

    22

  • 7/27/2019 sim Web

    23/61

    40

    jkl

    16

    60

    70

    Mno

    16

    4035

    23

  • 7/27/2019 sim Web

    24/61

    6. Application to implement lists in HTML.

    Code To implement :

    Subjects

    24

  • 7/27/2019 sim Web

    25/61

    1st Sem

    maths

    c

    communication

    IT

    2nd sem

    Data structuremicroprocessor

    Computer System Architecture

    3rd Sem

    java

    c++

    OR


    Practical Subjects

    There will be practical exams for some subjects like c, c++, java.To be

    sure, the

    performance-based methodologies rolled out by certification programs.g. The

    certification programs that have included experiential learning in their curricula

    25

  • 7/27/2019 sim Web

    26/61

    deserve commendation for raising the standards of IT credentials by making

    them more

    applicable to the industry.

    26

  • 7/27/2019 sim Web

    27/61

    7. Web site using Frames.

    Code To implement :

    Frame

    27

  • 7/27/2019 sim Web

    28/61

    28

  • 7/27/2019 sim Web

    29/61

    8.Image Map in HTML

    Map Of Goa

    Click on Betul. It will show the following map:

    29

  • 7/27/2019 sim Web

    30/61

    Map of Betul

    Click on Old Goa, it will show the following map.

    30

  • 7/27/2019 sim Web

    31/61

    Map of Old Goa

    31

  • 7/27/2019 sim Web

    32/61

    Code:

    Map

    Map of Goa

    DHTML

    32

  • 7/27/2019 sim Web

    33/61

    DHTML is not a language itself, but rather a combination of:

    HTML 4.0 (or XHTML 1.0)

    JavaScript -- the Web's standard scripting language

    Cascading Style Sheets (CSS) -- styles dictated outside a document's content

    Document Object Model (DOM) -- a means of accessing a document's individual

    elements

    Since the first edition of this book, Dynamic HTML has developed into a stable standard that

    is well supported by both Netscape 6 and Internet Explorer 5.5.

    Netscape Navigator 4.0 and IE 4.0 supported earlier, proprietary versions of DHTML, andthey differed greatly in their support for CSS and dynamically positioned elements. The

    differences between what these two browser versions called DHTML has created a million

    migraines among web developers. Accounting for the inconsistencies required creating twoseparate web pages or jumping through browser-detection hoops to give all users the same

    experience

    HTML stands for Dynamic HTML. The first thing that we need to clear about DHTML is that

    it is neither a language like HTML, JavaScript etc. nor a web standard. It is just a combination

    of HTML, JavaScript and CSS. It just uses these languages features to build dynamic web

    pages. DHTML is a feature of Netscape Communicator 4.0, and Microsoft Internet Explorer

    4.0 and 5.0 and is entirely a "client-side" technology.

    Features of DHTML:

    Simplest feature is making the page dynamic.

    Can be used to create animations, games, applications, provide new ways of

    navigating through web sites.

    DHTML use low-bandwidth effect which enhance web page functionality.

    Dynamic building of web pages is simple as no plug-in is required.

    Facilitates the usage of events, methods and properties and code reuse.

    CSS

    33

  • 7/27/2019 sim Web

    34/61

    CSS is a formatting language, used to provide more customized web pages and

    make it easier to make multiple pages use the same style. Its most common

    application is to style web pages written in HTML and XHTML, but the

    language can also be applied to any kind ofXML document, includingplain

    XML, SVG and XUL.

    Two ways to include CSS on a page

    One way is by loading it from an external file

    Other way is by embedding it directly in the source code of the page.

    Applications Of DHTML

    34

    http://en.wikipedia.org/wiki/Web_pagehttp://en.wikipedia.org/wiki/HTMLhttp://en.wikipedia.org/wiki/XHTMLhttp://en.wikipedia.org/wiki/XMLhttp://en.wikipedia.org/wiki/Plain_Old_XMLhttp://en.wikipedia.org/wiki/Plain_Old_XMLhttp://en.wikipedia.org/wiki/Scalable_Vector_Graphicshttp://en.wikipedia.org/wiki/XULhttp://en.wikipedia.org/wiki/Web_pagehttp://en.wikipedia.org/wiki/HTMLhttp://en.wikipedia.org/wiki/XHTMLhttp://en.wikipedia.org/wiki/XMLhttp://en.wikipedia.org/wiki/Plain_Old_XMLhttp://en.wikipedia.org/wiki/Plain_Old_XMLhttp://en.wikipedia.org/wiki/Scalable_Vector_Graphicshttp://en.wikipedia.org/wiki/XUL
  • 7/27/2019 sim Web

    35/61

    1) Application to show the use of comments in CSS.

    Code to implement:

    35

  • 7/27/2019 sim Web

    36/61

    H1{text-align:center;

    bgcolor:red;

    background-color:yellow;

    color:black;/*This is a comment*/

    font-family:Monotype Corsiva;

    font-size:50;}


    Simran

    .

    36

  • 7/27/2019 sim Web

    37/61

    2. Application to change the text Decoration in CSS.

    Code to implement:

    37

  • 7/27/2019 sim Web

    38/61

    h1 {text-decoration:overline;}

    h2 {text-decoration:line-through;}

    h3 {text-decoration:underline;}

    h4 {text-decoration:blink;}

    Simran Simran

    Simran

    Simran

    3. Application to show working of Inline CSS.

    38

  • 7/27/2019 sim Web

    39/61

    Code to implement:

    39

  • 7/27/2019 sim Web

    40/61

    BCA- 3D

    4. Application to show working of Internal CSS.

    40

  • 7/27/2019 sim Web

    41/61

    Code to implement:

    h1

    {

    color:red;

    background-color:yellow;

    font-family:Arial;

    font-size:"12px";

    }

    41

  • 7/27/2019 sim Web

    42/61

    Punjab College Of Technical Education

    Baddowal

    5. Application to change the color of the text in CSS

    42

  • 7/27/2019 sim Web

    43/61

    43

  • 7/27/2019 sim Web

    44/61

    Code to implement:

    body {color:red;}

    h1 {color:#00ff00;}

    p.ex {color:rgb(0,0,255);}

    Simran

    I am student of Punjab college of Technical Education.

    This is a paragraph with class="ex". This text is blue.

    44

  • 7/27/2019 sim Web

    45/61

    Introduction to Java Script

    JavaScript is aprototype-basedscripting language that is dynamic, weakly typed and

    has first-class functions. It is a paradigm language, supporting object-oriented, imperative,

    and functional. Programming styles. JavaScript was formalized in the ECMA

    Script language standard and is primarily used in the form ofclient-side JavaScript,

    implemented as part of a Web browserin order to provide enhanced user interfaces and

    dynamic websites. This enablesprogrammatic access to computational objects within a

    host environment.

    JavaScript's use in applications outside Web pages for example in PDF documents,

    site-specific browsers, and desktop widgets is also significant.

    JavaScript uses syntax influenced by that ofC. JavaScript copies many names and naming

    conventions from Java, but the two languages are otherwise unrelated and have very

    different semantics.

    Features

    JavaScript supports much of the structured programming syntax from C . style block-level

    scoping is not supported .JavaScript makes a distinction between expressions and statements.

    JavaScript is almost entirely object-based. JavaScript objects are associative arrays, augmented

    with prototypes. JavaScript has a small number of built-in objects such as Function and Date.

    Functions are first-class; they are objects themselves. As such, they have properties and

    methods, such as length and call and they can be assigned to variables, passed as

    arguments, return by other functions, and manipulated like any other object.

    JavaScript usesprototypes instead ofclasses forinheritance. It is possible to simulate many

    class-based features with prototypes in JavaScript.

    45

    http://en.wikipedia.org/wiki/Prototype-basedhttp://en.wikipedia.org/wiki/Scripting_languagehttp://en.wikipedia.org/wiki/Dynamic_languagehttp://en.wikipedia.org/wiki/Weak_typinghttp://en.wikipedia.org/wiki/First-class_functionshttp://en.wikipedia.org/wiki/Object-oriented_programminghttp://en.wikipedia.org/wiki/Imperative_programminghttp://en.wikipedia.org/wiki/Functional_programminghttp://en.wikipedia.org/wiki/ECMAScripthttp://en.wikipedia.org/wiki/ECMAScripthttp://en.wikipedia.org/wiki/Client-side_JavaScripthttp://en.wikipedia.org/wiki/Web_browserhttp://en.wikipedia.org/wiki/User_interfacehttp://en.wikipedia.org/wiki/Websitehttp://en.wikipedia.org/wiki/Computer_programminghttp://en.wikipedia.org/wiki/Application_softwarehttp://en.wikipedia.org/wiki/Portable_Document_Formathttp://en.wikipedia.org/wiki/Site-specific_browserhttp://en.wikipedia.org/wiki/Desktop_widgethttp://en.wikipedia.org/wiki/C_(programming_language)http://en.wikipedia.org/wiki/Java_(programming_language)http://en.wikipedia.org/wiki/Structured_programminghttp://en.wikipedia.org/wiki/C_(computer_language)http://en.wikipedia.org/wiki/Expression_(programming)http://en.wikipedia.org/wiki/Statement_(programming)http://en.wikipedia.org/wiki/Object-basedhttp://en.wikipedia.org/wiki/Object_(computer_science)http://en.wikipedia.org/wiki/Associative_arrayhttp://en.wikipedia.org/wiki/Subroutinehttp://en.wikipedia.org/wiki/First-class_functionhttp://en.wikipedia.org/wiki/Prototype-based_programminghttp://en.wikipedia.org/wiki/Class_(computer_science)http://en.wikipedia.org/wiki/Inheritance_(computer_science)http://en.wikipedia.org/wiki/Prototype-basedhttp://en.wikipedia.org/wiki/Scripting_languagehttp://en.wikipedia.org/wiki/Dynamic_languagehttp://en.wikipedia.org/wiki/Weak_typinghttp://en.wikipedia.org/wiki/First-class_functionshttp://en.wikipedia.org/wiki/Object-oriented_programminghttp://en.wikipedia.org/wiki/Imperative_programminghttp://en.wikipedia.org/wiki/Functional_programminghttp://en.wikipedia.org/wiki/ECMAScripthttp://en.wikipedia.org/wiki/ECMAScripthttp://en.wikipedia.org/wiki/Client-side_JavaScripthttp://en.wikipedia.org/wiki/Web_browserhttp://en.wikipedia.org/wiki/User_interfacehttp://en.wikipedia.org/wiki/Websitehttp://en.wikipedia.org/wiki/Computer_programminghttp://en.wikipedia.org/wiki/Application_softwarehttp://en.wikipedia.org/wiki/Portable_Document_Formathttp://en.wikipedia.org/wiki/Site-specific_browserhttp://en.wikipedia.org/wiki/Desktop_widgethttp://en.wikipedia.org/wiki/C_(programming_language)http://en.wikipedia.org/wiki/Java_(programming_language)http://en.wikipedia.org/wiki/Structured_programminghttp://en.wikipedia.org/wiki/C_(computer_language)http://en.wikipedia.org/wiki/Expression_(programming)http://en.wikipedia.org/wiki/Statement_(programming)http://en.wikipedia.org/wiki/Object-basedhttp://en.wikipedia.org/wiki/Object_(computer_science)http://en.wikipedia.org/wiki/Associative_arrayhttp://en.wikipedia.org/wiki/Subroutinehttp://en.wikipedia.org/wiki/First-class_functionhttp://en.wikipedia.org/wiki/Prototype-based_programminghttp://en.wikipedia.org/wiki/Class_(computer_science)http://en.wikipedia.org/wiki/Inheritance_(computer_science)
  • 7/27/2019 sim Web

    46/61

    Applications Java Script

    1. Application to display the date and time.

    Code to implement

    document.write(""+Date()+"");

    46

  • 7/27/2019 sim Web

    47/61

    2. Application to add two numbers.

    Code to implement

    function sum(a,b)

    {

    return a+b;

    }

    document.write(sum(4,3));

  • 7/27/2019 sim Web

    48/61

    3. Application to show the live clock

    Code to implement :

    function clock()

    {

    var d=new Date();

    var h=d.getHours();

    var m=d.getMinutes();

    var s=d.getSeconds();

    document.getElementById('clk').innerHTML=h+":"+m+":"+s;

    t=setTimeout('clock()',500);

    48

  • 7/27/2019 sim Web

    49/61

    }

    49

  • 7/27/2019 sim Web

    50/61

    4. Application to show an alert Box.

    Code to implement:

    function show()

    {

    alert("Going to delete it");

    }

    50

  • 7/27/2019 sim Web

    51/61

    5. Application to show a confirm box.

    Click on Save.

    51

  • 7/27/2019 sim Web

    52/61

    Code to implement

    function show()

    {

    var r=confirm("Are you sure you want to make changes ?");

    }

    52

  • 7/27/2019 sim Web

    53/61

    Introduction to ASP

    "Active Server Pages" abbreviated as ASP, is a server-side scripting environment developed

    by Microsoft. Using ASP, we can create and run dynamic and interactive web server

    applications. With ASP, we can combine HTML pages, script commands, and COM

    components to create interactive Web pages or powerful Web-based applications, which are

    easy to develop and modify.

    The default scripting language used for writing ASP is VBScript although we can use

    JavaScript. All ASP pages will be executed at the server and the page will have the extension

    ".asp".

    An ASP page cannot run by simply opening it in a web browser. The page must berequested through a web server that supports ASP, this is why ASP stands for Active Server

    Pages, no server, no active pages.

    When a browser requests an ASP page, the web server interprets any ASP contained

    within the web page before sending the HTML produced to the browser

    In this way, the entire ASP is run on the web server and no ASP will ever be passed back to

    the web browser.

    53

  • 7/27/2019 sim Web

    54/61

    Features

    1) Active Server Pages can develop a new generation of Web-based applications, including

    extending sales and customer service to the Web, and providing access to corporate databases

    and applications to any browser on an intranet.

    2) Active Server Pages allows organizations to extend the power of scripting on the server with

    ActiveX server components. These components can be created using Microsoft Visual Basic,

    Visual C++, Java, and other languages.

    3) Active Server Pages provides native support for both Microsoft JScript and VBScript.

    ActiveX scripting plug-ins are available for REXX, PERL, and Python.

    4) Active Server Pages can work with any Web browser. The output of an ASP file is plain

    HTML, the content of which can be customized for the capabilities of the client.

    5) Active Server Pages allows you to define application and session variables that can be carried

    across multiple pages in a Web site. This can be as simple as remembering a user's name, and it

    is necessary in applications such as online shopping to track product selections.

    6) Active Server Pages makes it easy to bring legacy database applications to the Web.

    IIS - Internet Information Server

    IIS is a set of Internet-based services for servers created by Microsoft for use with Microsoft

    Windows. IIS comes with Windows 2000, XP, Vista, and Windows 7. It is also available for

    Windows NT. IIS is easy to install and ideal for developing and testing web applications.

    With IIS, Microsoft includes a set of programs for building and administering Web sites, a

    search engine, and support for writing Web-based applications that access databases.

    Microsoft points out that IIS is tightly integrated with the Windows NT and 2000 Servers in a

    number of ways, resulting in faster Web page serving.

    54

  • 7/27/2019 sim Web

    55/61

    How to install PWS on Windows 95, 98, and Windows NT

    For Windows 98: Open the Add-ons folder on your Windows CD, find the PWS folder and

    runsetup.exe to install PWS.

    For Windows 95 or Windows NT: Download "Windows NT 4.0 Option Pack" from

    Microsoft, and install PWS.

    Test your web :

    After you have installed IIS or PWS follow these steps:

    Look for a new folder called Inetpub on your hard drive.

    Open the Inetpub folder, and find a folder named wwwroot.

    Create a new folder, like "My Web", under wwwroot.

    Write some ASP code and save the file as "test1.asp" in the new folder.

    Make sure your Web server is running.

    Open your browser and type "http://localhost/MyWeb/test1.asp", to view your first web

    The Global.asa file

    The Global.asa file is an optional file that can contain declarations of objects, variables, and

    methods that can be accessed by every page in an ASP application. All valid browser scripts

    (JavaScript, VBScript, JScript, PerlScript, etc.) can be used within Global.asa.

    The Global.asa file can contain only the following:

    Application events

    Session events

    55

  • 7/27/2019 sim Web

    56/61

    declarations

    TypeLibrary declarations

    the #include directive

    Variables

    A variable declared outside a procedure can be accessed and changed by any script in the ASP

    file. To declare variables accessible to more than one ASP file, declare them as session

    variables or application variables.

    Session Variables: Session variables are used to store information about one single user, and

    are available to all pages in one application. Typically information stored in session

    variables is name, id, and preferences.

    Application Variables: Application variables are also available to all pages in one

    application. Application variables are used to store information about all users in one

    specific application.

    Request, Response Objects

    Request and Response objects represent information coming into the Web server from the

    browser and information going out from the server to the browser. The Request object is

    called the input object and the Response object is called the output object.

    Response Object: The Response object methods gives us control over what you can send to

    the client from the web server. However, one of the most valuable uses for the Response

    object is in debugging your scripts. The Response object is used to send output to the client

    from the web server.

    Request Object:The Request object retrieves the values that the client browser passed to the

    server during an HTTP request. It is used to get information from the user. Using this object,

    you can dynamically create web pages and perform various server-side actions based on input

    from the user.

    56

  • 7/27/2019 sim Web

    57/61

    Cookie

    A cookie is often used to identify a user. A cookie is a small file that the server embeds on the

    user's computer. Each time the same computer requests a page with a browser, it will send the

    cookie too. With ASP, you can both create and retrieve cookie values.

    o The "Response.Cookies" command is used to create cookies.

    o The "Request.Cookies" command is used to retrieve a cookie value.

    Database Connectivity

    The common way to access a database from inside an ASP page is to:

    1. Create an ADO connection to a database.

    2. Open the database connection.

    3. Create an ADO recordset.

    4. Open the recordset.

    5. Extract the data you need from the recordset.

    6. Close the recordset.

    7. Close the connection.

    Connection Object

    The ADO Connection Object is used to create an open connection to a data source. Through this

    connection, you can access and manipulate a database.

    If you want to access a database multiple times, you should establish a connection using the

    Connection object. You can also make a connection to a database by passing a connection string

    via a Command or Recordset object.

    57

  • 7/27/2019 sim Web

    58/61

    The easiest way to connect to a database is to use a DSN-less connection. A DSN-less

    connection can be used against any Microsoft Access database on your web site. If you have a

    database called "web.mdb" located in a web directory like "c:/webdata/", you can connect to

    the database with the following ASP code:

    Screenshots of PCTE Web Site

    Home Page

    58

  • 7/27/2019 sim Web

    59/61

    Contact Us Page

    59

  • 7/27/2019 sim Web

    60/61

    Screenshots of Blog

    Home Page

    60

  • 7/27/2019 sim Web

    61/61

    61