Chapter – III

Creating a Web-based Client/Server Network

Creating a Web-based Client/Server Network
The chapter deals with:

(a) (b)

Designing the network; Downloading and installing a

Web server; (c) Developing a Microsoft Access

database; (d) Writing a Web-based

client/server application; and (e) network. Testing and managing the


in which client computers send requests to the server computer for data from its database. The required software is a Windows 95/98/2000/NT Web server. 6. Microsoft Access 97 or 2000. managing. 5. Develop a Microsoft Access database. Design a Web-based client/server network. After completing this project.htm. 3. 98. 2000 or NT operating systems. and the Internet 29 .Introduction A Web-based client/server network is a computer communication system. it can be accessed via Internet by any client computers around the world.htm?/Windows/ie/pws/main.html or The server can be set up on a Windows the investigator needs to reserve some computer equipped with Windows 95. 98. Manage and support the network. 2000 or NT computer connected to the Internet. which can be downloaded free at http://www. 2. and the server returns the results to the clients via Internet/WWW. an IT professional will be able to: 1. Download and install a Windows 95/98/2000/NT Web server.winfiles. Objectives This model includes learning activities ranging from designing a network to installing. and supporting it. To create a Web-based client/server network on personal computers. thus. testing. Test the Web-based client/server network. Write a client/server application with HTML and DHTML.

it turns the computer into a small-scale Web server for peer-to-peer or small group usage with a maximum of 10 concurrent connections.0 for Windows 95. Therefore.0 is installed on a Windows 95 computer. In addition. the future network developers or managers. TCP/IP operates on Ethernet and Token Ring LANs. Once PWS Microsoft Personal Web Server (PWS) 4. Then. and (d) Writing a client/server application. the investigator can provide a step-by-step approach to achieving the objectives. Designing a Web-based Client/Server Network A Web-based client/server network uses the Transmission Control Protocol/Internet Protocol (TCP/IP) for data This section describes in detail how to accomplish the first four steps of the activities: (a) Designing a Web-based client/server network. (c) Developing a Microsoft Access database.0 is fully integrated into the Windows 95 Task Bar and Control Panel.0 would enable us.htm. (b) Downloading and installing a Web server.htm?/Windows/ie/pws/main. server-side database for client-side users to send and receive data via the Internet. making it easy to start and stop 30 . PWS 4. and even on customary telephone lines that are connected to a modem.connection. not only how to publish Web pages on the Web servers. on various WANs. a well designed Webbased network often does not require extra hardware except for the extra software—a Web server. but also how to set up a Webbased. which is downloaded free at http://www. PWS 4.

the Personal Web Manager of PWS 4. open the My Documents file folder and double-click the download. Then.exe file. Click Download Microsoft Personal Web Server 4. If the computer was configured differently. and Network.0 is installed. testing. When initial download is completed. a new icon on the Windows 95 Task Bar can be found. Microsoft. and managing the Web-based client/server network and Web applications.0 for Windows 95 at the Download & Trial Center. and 3 on the screen.0 for Windows 95 The following steps illustrate how to download and install PWS 4. Once PWS 4. By clicking the icon on the desktop. 2. Read the agreement. Activate Netscape Communicator or Internet Explorer browser. and OK. 3. Service. (b) Select Add. 4. click download. Use Search at the Microsoft home page for Personal Web Server 4.HTTP and FTP services whenever on PC. installing. Downloading and Installing PWS 4.htm?/Windows/ie/pws/mai n.0 will be displayed as shown in Figure 1.exe and save it in computer’s My Documents file folder.0 for Windows 95 on your PC: 1. Add. then enter http://www.0 for Windows.htm in the Location: Therefore. you may need to take the following additional steps: (a) Go to My Computer. Personal Web Server. 31 . follow Download Steps 1. this desktop Web server is ideal for learning activities such as developing. Control Panel. click OK to start downloading and installing PWS 4. and press [Enter]. 2.

5. Now we need to create a new file folder at the [C:] drive of the computer as C:\pws for the new client/server application and database files we will develop in the next sections as well as for the virtual directory of the Web server. The virtual directory can be created as follows: 32 . 6.

then click OK. To create our home page with the PWS home page wizard. and open messagedrop box by just clicking the respective hyperlinks. We can also edit our home page. then click IP Address to find the Write down the IP address for the server’s URL. is installed on the PC and we are ready to publish Web pages on it. To allow the clients to visit the Web site on a browser.(a) Double-click the PWS 4. click the Publish icon for directions.0 (see Figure 1). click the Web Site icon and follow the directions. then click the Advanced icon.0. Be sure to publish or save the Web pages in the C:\pws file folder. and Network. click Properties. which is a number. we can click the Tour icon on the Personal Web Manager of PWS 4.0 icon to activate it. 7. Now the Web server. To have an overview of PWS 4. 8. Now knowing the computer’s IP address. Select TCP/IP. type pws in the Alias: box. Control Panel. and (c) server’s URL. we need to provide the server’s Uniform Resource Locator (URL). We can find the computer’s IP address in this way: (a) (b) Go to My Computer.htm. the clients can visit our Web site on a browser anywhere and anytime as long as the server is on. PWS 4. which consists of http://<computer IP address>/pws/filename. To publish new Web pages. view guest book.0. 33 . (c) Type C:\pws in the Directory: box. then click Add. (b) Be sure that <home> is highlighted.

we need to develop and install a Webbased database on the server. 4. The following steps indicate how to develop and install a simple Webbased Microsoft Access 97 or 2000 database: 1. names.Developing a Microsoft Access Database In order for your Web server to be dynamic and gather information from and send information to users. For users to access data in this database from any Internet-connected client computer. Class 3. Figure 1: The Main Window of Personal Web Server 4. Last name.0 for Windows 95 34 .mdb. First name. Create a simple student class registration database with one table named “Student. Class 2.” 2. Enter student IDs. and Class 5 for the student table (see Table 1 for example). Class 1. and class registration information into the table. Class 4. Save the database in the C:\pws file folder as C:\pws\School. 3. Create the field names of Student ID. we also need to write and install a Web-based client/server application on our PC. 5.

a DHTML file. will provide the respective student information as shown in Figure 3. activate Notepad in the Accessories window. the result form will respond so and ask to re-enter the correct ID.asp" Method="POST"> … </form>. The interactive Webbased client/server 35 . Result form with DHTML. After entering the HTML file. Figure 2 shows the request form viewed with a Netscape Communicator browser. then type the following HTML file. the Results. Visual Basic. We can write these files with Web development tools such as Netscape Composer.htm in the File name: box and click the Save button.Writing a Web-based Client/Server Application This application consists of two Web files: (a) A request form written with HTML and (b) A result form written with DHTML. If the ID is not correct. One can use a Web development tool to create this request form or write it with HTML on Windows Notepad as follows. or write the files with HTML and DHTML on Windows Notepad.asp.*). The following two sections show how to write these files with HTML and DHTML.asp. Save in: C:\pws. Save as type: All Files (*. The form gathers and sends the ID to the server for results from the Web database via the Active Server Pages (ASP) file: Results. First. Request form with HTML. Save As …. The key part of this file is the fill-in form tag: <form name="request" Action= "Results. Macromedia Dreamweaver. be sure to proofread it carefully. NetObjects Fusion. and type request. Microsoft FrontPage. shown in Exhibit 1. If the ID is correct. or use a combination of these tools. then select File. HTML is limited to writing static Web pages for only publishing or posting information.

compile-free application environment that combines scripting. and robust database publishing for creating dynamic Web applications.applications require dynamic Web pages with DHTML. One can also 36 . HTML. One can use a Web development tool like Microsoft FrontPage 98 or 2000 to first build an HTML page. and finally save it as an . ASP is an open. then insert server-side scripts. One can build DHTML pages by using ASP as shown in Figure 3.asp file.

asp in the File name: box and click the Save button. Save as type: All Files (*. then select File.*). the 37 .use Windows Notepad or any other text editor to write the result form as shown in Figure 3 with DHTML as shown in the following exhibit: When the file is completed. be sure to proofread it. Save As …. Save in: C:\pws. and type Results. As shown in the foregoing ASP file.

The If …Then … Else Statement within the delimiters <% … %> is used for checking whether or not the submitted Student ID is correct. 38 . These delimiters tell the ASP engine that everything between the delimiters belongs to the server-side scripting statements for the execution of data communication. Now the creation of the Web-based client/server network on the PC is completed. and it is ready for testing. not for browsing. Therefore. the script cannot be viewed as source code nor be copied from a client computer’s Web browser.delimiters <% … %> are used to open and close script blocks of the file.

asp" Method="POST"> <p> Enter Student ID for class registration information:</p> <blockquote> <table border = "0"> <tr> <td align="right"> <i>Student ID </i></td> <td><input type="text" size=25 name="StudID"> </td> </tr> </table> </blockquote> <p> <input type="submit" value = "Submit StudID"> <input type="reset" value = "Reset Form"> </p> </form> <hr> <h10>Copyright© 1999</h10> </body> </html> 39 .htm File <html> <head><title>Request Information from the Server</title></head> <body> <h1> Please enter Student ID </h1> <hr> <form name="request" Action="Results.Exhibit 1: HTML Code for request.

If the request form does not show on the screen.htm file has coding errors or was not saved in the C:\pws file folder. 2005 in the box and click the Submit StudID button. Next.Jet. it is possible that the request. Therefore. Fourth. 40 . and type http://<ourcomputer IP address>/pws/request. the result form as illustrated in Figure 3 should be on the screen. testing it at any client computers connected to the Internet. If a wrong ID number was submitted. activate Netscape Communicator or Internet Explorer browser. The Microsoft. testing the network on the local host—Our PC. you need install the provider on your PC.Jet provider is a default database engine in Microsoft Office 97 and 2000 for data communication with Access 97 and 2000. this means Microsoft.51 provider is not available on your PC.OLEDB. Then. for example. you can enter a student ID. if the request form is on the screen.3.htm) in the Location: box and press [Enter].Testing the Webbased Client/Server Network Testing the network requires two steps: first. the screen would respond with this message: “Sorry!!! Student ID number was not found!!!” If a correct ID number was submitted and the screen shows a message like “… ADO could not find the specified provider…” instead of the result form. double-click the Personal Web Server icon to make sure it is running.htm (or http://localhost /pws/ request. and then. the request form as shown in Figure 2 should be on your computer screen. Second. which requires you to solve the problem. Testing the network on your PC To start with.

open connectString 41 .3.Exhibit 2: DHTML Code for results.CreateObject("ADODB.Connection") set reTitleList = Server.Recordset") myConnection.mdb" set myConnection = Server. Persist Security Info=False.asp File <html> <head><title>Database Programming with Visual Basic 6.51.0</title></head> <body> <center> <h2> Student Class Registration Information </h2> <h3> A Test of the Web-Based Client/Server Programming with Visual Basic 6.Jet. Data Source=C:\pws\School.0</h3><br> <% dim myConnection dim rsTitleList dim connectString dim sqlString dim requestStudID connectString = "Provider=Microsoft.CreateObject("ADODB.OLEDB.

Begin column header row --> <tr> <td valign = top bgcolor="#800000"> <font style="Arial narrow" color= "#ffffff" size = 3>Student ID</font> </td> <td valign = center bgcolor="#800000"> <font style="Arial narrow" color= "#ffffff" size = 3>Lastname</font> </td> <td valign = center bgcolor="#800000"> <font style="Arial narrow" color= "#ffffff" size = 3>Firstname</font> </td> <td valign = center bgcolor="#800000"> 42 .Execute(sqlString) if (rsTitleList.eof) then response.write("Sorry!!!.Form("StudID") sqlString = "Select * from Student where StudentID = " & requestStudID set rsTitleList = myConnection. Student ID Number " & requestStudID _ & " was not found!!!") else %> <table align = center Colspa = 14 cellpadding = 10 border = 0 width = 300> <!-.requestStudID = Request.bof) and (rsTitleList.

Get Data--> <% do while not rsTitleList.<font style="Arial narrow" color= "#ffffff" size = 3>Class 1</font> </td> <td valign = center bgcolor="#800000"> <font style="Arial narrow" color= "#ffffff" size = 3>Class 2</font> </td> <td valign = center bgcolor="#800000"> <font style="Arial narrow" color= "#ffffff" size = 3>Class 3</font> </td> <td valign = center bgcolor="#800000"> <font style="Arial narrow" color= "#ffffff" size = 3>Class 4</font> </td> <td valign = center bgcolor="#800000"> <font style="Arial narrow" color= "#ffffff" size = 3>Class 5</font> </td> </tr> <!-.EOF %> <tr> <td BGcolor="f7efde" align = center> <font style = "arial narrow" size = 3> <%=rsTitleList("StudentID")%> </font> </td> <td BGcolor="f7efde" align = center> 43 .

<font style = "arial narrow" size = 3> <%=rsTitleList("Lastname")%> </font> </td> <td BGcolor="f7efde" align = center> <font style = "arial narrow" size = 3> <%=rsTitleList("Firstname")%> </font> </td> <td BGcolor="f7efde" align = center> <font style = "arial narrow" size = 3> <%=rsTitleList("Class 1")%> </font> </td> <td BGcolor="f7efde" align = center> <font style = "arial narrow" size = 3> <%=rsTitleList("Class 2")%> </font> </td> <td BGcolor="f7efde" align = center> <font style = "arial narrow" size = 3> <%=rsTitleList("Class 3")%> </font> </td> <td BGcolor="f7efde" align = center> <font style = "arial narrow" size = 3> <%=rsTitleList("Class 4")%> </font> </td> <td BGcolor="f7efde" align = center> <font style = "arial narrow" size = 3> <%=rsTitleList("Class 5")%> </font> </td> </tr> 44 .

<%rsTitleList.  First. Now we have successfully created a simple Webbased client/server network on our PC. Then. Once the provider is installed on the PC. the request form as shown in Figure 2 would be on the computer screen for you to enter a student ID and to get a result form as shown in Figure 3. Testing the network at client PCs When the Web-based client/server network works on the local host PC.htm and press [Enter].  Second. we should be able to access data in the Web-based database on the PC via a Web browser.0 on the PC. we can test the network at any client PCs with the Internet access as follows. type http://<your computer IP address>/pws/request. 45 . in the browser’s Location: box.MoveNext%> <%loop %> </table> </center> <%End if %> </body> </html> We can also install the provider by installing Microsoft Visual Basic 6. activate Netscape Communicator or Internet Explorer browser on a client PC.

the personal pages such as student résumé or profile. Finally. instructors. Findings and Conclusion Create a Web-based client/server network on PCs has the following pedagogical and practical implications: First. Instead of having the request. management. and e -commerce. Students can also update the class registration database by deleting and adding data. extranets. and trouble shooting. this project provides instructors. Second. 46 . teachers and other entrepreneurs are able to develop and support other Web-based client/server networks and database applications for organizational intranets. skills of managing and supporting the network can be developed.htm” for the server.Managing and Supporting the Network When the Web-based client/server network is running.htm file as the first page of the server. installation. and other frequently used Web sites. the investigator can teach how to create a homepage named “index. learning through the project with innovative ideas and hands-on activities. students and other entrepreneurs with an innovative approach to using the Internet and Web technologies for overcoming the problem of lack of learning in computer network development. and troubleshooting. problem solving. which provides links to the request form. through this project. students. students and other entrepreneurs can teach how to use different tools to write a Web-based client/server database application with HTML and DHTML and how to develop skills in decision making.

Sign up to vote on this title
UsefulNot useful

Master Your Semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master Your Semester with a Special Offer from Scribd & The New York Times

Cancel anytime.