cita 310 section 7 installing and testing a programming environment (textbook chapter 7)

17
CITA 310 Section 7 Installing and Testing a Programming Environment (Textbook Chapter 7)

Upload: kelley-pearson

Post on 18-Jan-2016

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CITA 310 Section 7 Installing and Testing a Programming Environment (Textbook Chapter 7)

CITA 310 Section 7

Installing and Testing a Programming Environment

(Textbook Chapter 7)

Page 2: CITA 310 Section 7 Installing and Testing a Programming Environment (Textbook Chapter 7)

The Need for Programming Languages Web pages with just HTML

statements are static pages Pages that contain programming

statements allow changes and they are called dynamic pages

Programming languages can also be used to update databases and communicate with other systems

Page 3: CITA 310 Section 7 Installing and Testing a Programming Environment (Textbook Chapter 7)

Web-based Programming Environment Common Gateway Interface (CGI)

A protocol that allows the operating system to interact with the Web server

Practical extraction and reporting language (Perl) First popular language for Web servers

Java Server Pages (JSP) Language similar to Java

Page 4: CITA 310 Section 7 Installing and Testing a Programming Environment (Textbook Chapter 7)

Web-based Programming Environment

Active Server Pages (ASP) Script-based environment available on all IIS

Web servers ASP.NET

Compiled programs operate under .NET Framework

PHP Hypertext Protocol (PHP) Popular language available on most platforms

The structure of JSP, ASP, and PHP are similar

Page 5: CITA 310 Section 7 Installing and Testing a Programming Environment (Textbook Chapter 7)

Using Forms The following HTML produces a form

When the submit button is pressed, the data in the form is sent to the file designated as filename

Page 6: CITA 310 Section 7 Installing and Testing a Programming Environment (Textbook Chapter 7)

Using ASP to Process a Form

The following file displays the information from the form

Notice how the items such as "first" match the text names on the form

ASP uses <% and %> for opening and closing tags <%=request()%> is one way to retrieve data from the

form

Page 7: CITA 310 Section 7 Installing and Testing a Programming Environment (Textbook Chapter 7)

ASP.NET ASP.NET is one of the many

languages available under the .NET Framework that can be used for the Web

The programming model of ASP.NET is superior to that of ASP Has modules for data validation that

differentiates between browsers Producing sophisticated reports is much

easier

Page 8: CITA 310 Section 7 Installing and Testing a Programming Environment (Textbook Chapter 7)

ASP.NET Program that Combines Form and Output

Page 9: CITA 310 Section 7 Installing and Testing a Programming Environment (Textbook Chapter 7)

Perl Script to Display Contents of a Form Notice how $cgi->param("first") is

similar to ASP’s request("first")

Page 10: CITA 310 Section 7 Installing and Testing a Programming Environment (Textbook Chapter 7)

Programming with Databases

Microsoft uses two methods to bridge the gap between programming languages and databases Open Database Connectivity (ODBC)

The original standard Object Linking and Embedding Database

(OLEDB) Current standard which is faster and more flexible

Linux often uses Java Database Connectivity (JDBC)

You can also have a direct connection between the language (such as PHP) and the database (such as MySQL)

Page 11: CITA 310 Section 7 Installing and Testing a Programming Environment (Textbook Chapter 7)

Producing a Report Connect to the database Execute a SQL select statement to

retrieve data from a table Put the data in a recordset

Also known as a resultset, depending on the environment

Loop through the recordset and display the contents

Page 12: CITA 310 Section 7 Installing and Testing a Programming Environment (Textbook Chapter 7)

A Report in ASP

Page 13: CITA 310 Section 7 Installing and Testing a Programming Environment (Textbook Chapter 7)

Using Data Source Names (DSNs) DSNs are connections to databases that

an administrator creates on the server They encapsulate the information on

the previous slide concerning the connection information

The Data Sources (ODBC) wizard is in the Control Panel

Once it is created, you can create a connection withConn.open "DSN=humanresources;uid=sa"

Page 14: CITA 310 Section 7 Installing and Testing a Programming Environment (Textbook Chapter 7)

Programming with ASP.NET

Although there is a connection and you send it a SQL select statement, the DataGrid component creates the report

Page 15: CITA 310 Section 7 Installing and Testing a Programming Environment (Textbook Chapter 7)

Programming with PHP Note the

similarity between ASP and PHP, and how different they are from ASP.NET

Warning: Codes poorly written

Page 16: CITA 310 Section 7 Installing and Testing a Programming Environment (Textbook Chapter 7)

Installing PHP in Apache You may insert the following lines

into your Apache httpd.conf configuration file to load the PHP module for Apache 2.2:

LoadModule php5_module "C:/php/php5apache2_2.dll"

AddHandler application/x-httpd-php .phpPHPIniDir "C:/php"

Page 17: CITA 310 Section 7 Installing and Testing a Programming Environment (Textbook Chapter 7)

Server-Side Includes (SSI) SSI provide a means to add

dynamic content to existing HTML documents.

SSI directives have the following syntax:

<!--#element attribute=value attribute=value ... -->