Presentation is loading. Please wait.

Presentation is loading. Please wait.

2440: 141 Web Site Administration Web Server-Side Programming Professor: Enoch E. Damson.

Similar presentations


Presentation on theme: "2440: 141 Web Site Administration Web Server-Side Programming Professor: Enoch E. Damson."— Presentation transcript:

1 2440: 141 Web Site Administration Web Server-Side Programming Professor: Enoch E. Damson

2 Programming Languages Programming languages are used to develop programs that help: Input data Processes data Store data Output data Web Server-Side Programming2

3 Programming Programming is accomplished in two ways: Sequentially Using variables and procedures/functions Object-Oriented Using classes and objects which have: Attributes (variables) Methods (functions/procedures) Web Server-Side Programming3

4 Programs Programs are written to perform specific tasks Programming is accomplished using major elements such as: Syntax and Expressions Comments Literal Values Data Types and Variables Input/Output Data Arithmetic Operations Logical Operations Selections/Decisions Repetitions/Looping Arrays Web Server-Side Programming4

5 Web Programming Languages Web pages that contain only HTML/XHTML statements are called static pages Web pages that contain programming statements are known as dynamic pages (allow the content to change) Web Server-Side Programming5

6 Web Programming Languages… Programming languages can be used to create: Dynamic webpages on client Web browsers Using client-side scripting languages such as JavaScript and VBScript Dynamic webpages that run on Web servers and update databases Using server-side scripting languages such as Java Server Pages (JSP), Active Server Pages (ASP), ASP,NET, PHP, Coldfusion, etc Using SQL on DBMSs such as Oracle, MySQL, SQL Server, DB2, etc Web Server-Side Programming6

7 Server-Side Programming Server-side programs provide dynamic content and allows interaction with Web users using: DHTML Active Server Pages (ASP) Servlets and Java Server Pages (JSP) PHP: Hypertext Preprocessor (PHP) Practical Extraction and Reporting Language (Perl) Databases Web Server-Side Programming7

8 Dynamic Documents Dynamic HTML (DHTML) is a term for a combination of client-side technologies that produce dynamic documents DHTML can be used to create simple animations, images, and text with resources such as: HTML/XHTML Style sheets (CSS) Client-side scripting (JavaScript or VBScript) Web Server-Side Programming8

9 Web Applications Web applications use a combination of the following HTML/XHTML Style sheets (CSS) Client-side scripting languages such as JavaScript or VBScript Server-side scripting languages Such as ASP, ASP.NET, PHP, JSP, etc Database Management Systems (DBMS) to create and manipulate databases Usually using the embedded Structured Query Language (SQL) especially in Relational Databases. Web Server-Side Programming9

10 HTML Form Page 1. 2. 3. HTML Form Page 4. 5. 6. 7. 8. 9. 10. 11. 1. Opening tag 2. Opening tag 3. Specifying the title of the page (HTML Form Page) with the two-sided tag 4. Closing tag 5. Opening tag 6. Opening tag specifying the recipient CGI file using the action attribute and the method of sending data (using the HTTP’s post) with the method attribute 7. Using the tag’s type attribute to specify the form component (text for textbox) being used to accept data, and the name attribute to uniquely identify the component 8. Using the tag’s type attribute to specify a submit button (submit) being used to send data, and the value attribute for the button’s caption 9. Closing tag 10. Closing tag 11. Closing tag Web Server-Side Programming10

11 DHTML Sample Code 1. 2. 3. 4. document.writeln("Hello World"); 5. 6. 7. p {color: blue} 8. 9. DHTML Page 10. 11. 12. Embedded style 13. Inline style 14. 15. 1. Opening tag 2. Opening tag 3. Opening tag specifying the script language of choice (JavaScript) 4. Displays text (“Hello World”) on a browser 5. Closing tag 6. Opening tag specifying the style sheet type (css – cascading style sheet) 7. Specifying a value of blue as the text color for all paragraphs on the page – Embedded style 8. Closing tag 9. Specifying the title of the page (DHTML Page) with the two-sided tag 10. Closing tag 11. Opening tag 12. Displays a paragraph on the page 13. Displays a paragraph with an Inline style 14. Closing tag 15. Closing tag Web Server-Side Programming11

12 Active Server Pages (ASP) Microsoft’s server-side technology for creating dynamic Web pages Based on Microsoft’s Component Object Model (COM) and ActiveX Controls COM is a Microsoft standard that defines how software components from different vendors can work together ActiveX controls are components built using the COM specifications VBScript and JavaScript are the most popular ASP languages but any language (such as C++, Perl, Java) that supports COM can also be used Web Server-Side Programming12

13 ASP Page 1. 2. 3. 4. 1. Specifies the ASP script language using the @ directive 2. Opening tag 3. Displays text on a page using the = directive 4. Closing tag Web Server-Side Programming13

14 Servlets and Java Server Pages (JSP) Sun Microsystem’s alternative to Microsoft’s ASP Rely on Sun’s Java programming language Java – a portable object-oriented language Servlets – are server-side programs like CGI programs but run as part of the Web server instead of executing as separate processes (as CGI scripts do) JSP – provides the same benefits of servlets along with the benefits of SSI JavaBeans – a component model written in Java to allow developers write reusable components JSP’s solution to separate content from presentation Web Server-Side Programming14

15 JSP Page 1. 2. 3. 1. Opening tag 2. Displays text on a page using the = directive 3. Closing tag Web Server-Side Programming15

16 Perl CGI Script 1. #!/cgi-bin/perl 2. #hello.cgi – Sample perl script 3. print “Content-type: text/html\n\n”; 4. use CGI qw(:standard); 5. use strict; 6. my ($fname); 7. $fname = param(‘firstname’); 8. print “<HTML\n”; 9. print “ Perl CGI Script \n”; 10. print “ Hello $fname \n”; 11. print “ \n”; 1. Location of the Perl interpreter (required in UNIX; optional in Windows) 2. Comment (non-executable statement) 3. Sends an HTML document type (text/html) to the browser using the HTTP header line (Content-type) and creates a new line 4. Allows the script to parse data from the form when received 5. Prevents Perl from using undeclared variables 6. Declares a scalar variable (preceded by a $ sign) named fname 7. Assigns a form data to a variable 8. Sends the opening tag to the browser 9. Sends the two-sided and tags to the browser 10. Sends the two-sided and contents of the page to the browser 11. Sends the closing tag to the browser Web Server-Side Programming16

17 PHP: Hypertext Preprocessor (PHP) A simple open-source server-side programming language used for developing interactive Web documents Includes object-oriented programming (OOP) capabilities Web Server-Side Programming17

18 PHP Page 1. 2. 3. 1. Opening tag 2. Displays text on a browser 3. Closing tag Web Server-Side Programming18

19 Databases Databases are a collection of data and metadata (data about other data) about entities using a database management system (DBMS) DBMS – software used to create, construct and manipulate databases E.g. Oracle, Microsoft SQL Server, MySQL, etc Entities – any thing, place, event, etc that data is collected about Data is collected in the form of attributes to help make up records Attributes – description of an entity Records – collection of attributes Web Server-Side Programming19

20 DBMS Most DBMSs use a data definition language (DDL) and data manipulation language (DML) to help create and manipulate databases The most widely used DDL/DML for databases is the structured query language (SQL) – pronounced “sequel” Used by virtually all DBMSs Web Server-Side Programming20

21 SQL SQL is a language embedded in virtually all DBMSs to perform several tasks including: Creating the structure of database objects Using the create command Removing database objects Using the drop command Changing the structure of database objects Using the alter command Web Server-Side Programming21

22 SQL… Other SQL functionalities include: Adding records into database tables Using the insert command Removing records from database tables Using the delete command Changing records in database tables Using the update command Retrieve records from database tables Using the select command Web Server-Side Programming22

23 Web Servers and Server-Side Programming Language Choosing a programming language for server-side programming depends on the type of Web server to use and vice versa The two most popular Web servers allows you to choose their most friendliest programming language IIS is most friendly with ASP, ASP.NET Apache is most friendly with PHP, JSP, etc Web Server-Side Programming23


Download ppt "2440: 141 Web Site Administration Web Server-Side Programming Professor: Enoch E. Damson."

Similar presentations


Ads by Google