Using the Internet to publish data and applications

Slides:



Advertisements
Similar presentations
Web forms and CGI scripts Dr. Andrew C.R. Martin
Advertisements

Adding Dynamic Content to your Web Site
Web Technologies Using the Internet to publish data and applications.
CGI Programming Part 2. Input Tags Many different ways of getting data from the user. The tag is used most often. has a type attribute –Specifies the.
Web Automation Using Perl to automate web surfing.
Databases and Perl Using Perl to talk to databases.
CGI programming in Perl Learning Objectives: 1. To understand how a CGI program works in Perl and how to make it runnable in web browsers 2. To learn how.
APACHE SERVER By Innovationframes.com »
 2004 Prentice Hall, Inc. All rights reserved. Chapter 25 – Perl and CGI (Common Gateway Interface) Outline 25.1 Introduction 25.2 Perl 25.3 String Processing.
Linux Operations and Administration
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
Set 5: Perl and Database Connections
1 Lecture 7 Introduction to Bioinformatics Dr N AYDIN.
Apache Server The Apache Server Apache is a WWW server that implements the HTTP protocol. Apache runs as a daemon. This means that it is a resident.
1 HTML and CGI Scripting CSC8304 – Computing Environments for Bioinformatics - Lecture 10.
HTML BASICS Creating Web Pages with HTML CIS 133 Web Programming Concepts 1.
2 1 Sending Data Using a Hyperlink CGI/Perl Programming By Diane Zak.
CP476 Internet Computing CGI1 CGI is a common way to provide for specific computations on server side, interactions with users, or access to databases.
Using Html Basics, Text and Links. Objectives  Develop a web page using HTML codes according to specifications and verify that it works prior to submitting.
Perl Web Page – Just Enough Pepper. Web site Set up the top of your script to indicate perl and plain text #!/usr/bin/perl print "Content-type:text/plain\n\n";
CSU - DCE Advanced Perl CGI Operation - Fort Collins, CO Copyright © XTR Systems, LLC Introduction to the Common Gateway Interface (CGI) on the.
1 Basic Perl CGI Programming. 2 Issues How and when your program is invoked. Generating Response –HTTP Headers –HTML (or whatever document type you want)
Images and Tables ables.asp.
CSU - DEO Introduction to CGI - Fort Collins, CO Copyright © XTR Systems, LLC Introduction to the Common Gateway Interface (CGI) Instructor: Joseph DiVerdi,
IS-907 Java EE World Wide Web - Overview. World Wide Web - History Tim Berners-Lee, CERN, 1990 Enable researchers to share information: Remote Access.
 2001 Prentice Hall, Inc. All rights reserved. Chapter 17 - Web Automation and Networking Outline 17.1Introduction 17.2Introduction to LPW 17.3 LPW Commands.
 2001 Prentice Hall, Inc. All rights reserved. Chapter 7 - Introduction to Common Gateway Interface (CGI) Outline 7.1Introduction 7.2A Simple HTTP Transaction.
Sending data with CGI/Perl Please use speaker notes for additional information!
University of Kansas Department of Electrical Engineering and Computer Science Dr. Susan Gauch April 21, 2005 I T T C Introduction to Web Technologies.
What is XHTML? XHTML stands for Extensible Hypertext Markup Language
Chapter 7 - Introduction to Common Gateway Interface (CGI)
CGI programming Using Apache.
CSE 102 Introduction to Web Design and Programming
CIS 228 The Internet 9/20/11 XHTML 1.0.
Validation.
Doctypes and domain names
CS120 The Information Era TOPICS: CGI-Scripts 4/18/05
Introduction to PHP FdSc Module 109 Server side scripting and
CGI I: Basics Web Programming.
XHTML Basics.
Introduction to Programming the WWW I
XHTML 1 by Carsomyr.
CSE 102 Introduction to Web Design and Programming
Validation.
HTML: Basic Tags & Form Tags
Introduction to HTML5.
Perl Web Page – Just Enough
CGI Programming Part II UNIX Security
XHTML Basics.
XHTML Basics.
Introduction There are several good reasons for taking CS142: Web Applications: You will learn a variety of interesting concepts. It may inspire you to.
CS 142 Lecture Notes: Rails Controllers and Views
Your Page and Review Objectives
Note that iframes are available in HTML5.
CGI programming Using Apache.
HTML Forms Internet Technology.
HTML Forms Internet Technology.
XHTML Basics.
Enabling CGI & PHP With Apache
Introduction to Bioinformatics
Introduction to HTML5.
XHTML Basics.
Dreamweaver.
XHTML Basics.
XHTML Validation.
Introduction to HTML5.
محمد احمدی نیا XHTML محمد احمدی نیا
CGI I: Basics Web Programming.
HTML: Basic Tags & Form Tags
Creating Web Documents
Presentation transcript:

Using the Internet to publish data and applications Web Technologies Using the Internet to publish data and applications

The Web Development Infrastructure

Creating Content For The WWW http://www.htmlprimer.com

Take the time to learn HTML Maxim 15.1 Take the time to learn HTML

A Simple HTML Page <HTML> <HEAD> <TITLE>A Simple HTML Page</TITLE> </HEAD> <BODY> This is as simple a web page as there is. </BODY> </HTML>

Producing HTML #! /usr/bin/perl -w # produce_simple - produces the "simple.html" web page using # a HERE document. use strict; print <<WEBPAGE; <HTML> <HEAD> <TITLE>A Simple HTML Page</TITLE> </HEAD> <BODY> This is as simple a web page as there is. </BODY> </HTML> WEBPAGE

Producing HTML, cont. #! /usr/bin/perl -w # produce_simpleCGI - produces the "simple.html" web page using # Perl's standard CGI module. use strict; use CGI qw( :standard ); print start_html( 'A Simple HTML Page' ), "This is as simple a web page as there is.", end_html;

Results from produce_simpleCGI <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US"> <head><title>A Simple HTML Page</title> </head><body>This is as simple a web page as there is.</body></html>

Create static web pages either manually or visually Maxim 15.2 Create static web pages either manually or visually

The dynamic creation of WWW content #! /usr/bin/perl -wT # whattimeisit - create a dynamic web page that includes the # current date/time. use strict; use CGI qw( :standard ); print start_html( 'What Date and Time Is It?' ), "The current date/time is: ", scalar localtime, end_html;

Results from whattimeisit ... <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US"> <head><title>What Date and Time Is It?</title></head> <body>The current date/time is: Mon Aug 25 23:21:55 2003</body></html>

And some time later ... <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US"> <head><title>What Date and Time Is It?</title></head> <body>The current date/time is: Tue Aug 26 08:04:23 2003</body></html>

Always enable ``taint mode'' for server-side programs Maxim 15.3 Always enable ``taint mode'' for server-side programs

Preparing Apache For Perl $ chkconfig --add httpd $ chkconfig httpd on $ locate httpd.conf

Configuring Apache /etc/httpd/conf/httpd.conf ServerAdmin root@localhost DocumentRoot "/var/www/html" /var/www/html/index.html ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

Running Apache /etc/init.d/httpd start http://localhost/

Test your web-site on localhost prior to deployment on the Internet Maxim 15.4 Test your web-site on localhost prior to deployment on the Internet

Testing the execution of server-side programs $ su $ cp whattimeisit /var/www/cgi-bin $ chmod +x /var/www/cgi-bin/whattimeisit $ <Ctrl-D>

The ``Server Error'' web page. figSERVERERROR.eps

The ``What Date and Time Is it?'' web page. figSERVERTIME.eps

Sending Data To A Web Server #! /usr/bin/perl -wT # The 'match_emblCGI' program - check a sequence against the EMBL # database entry stored in the # embl.data.out data-file on the # web server. use strict; use CGI qw/:standard/; print header; open EMBLENTRY, "embl.data.out" or die "No data-file: have you executed prepare_embl?\n"; my $sequence = <EMBLENTRY>; close EMBLENTRY;

match_emblCGI, cont. print start_html( "The results of your search are in!" ); print "Length of sequence is: <b>", length $sequence, "</b> characters.<p>"; print h3( "Here is the result of your search:" ); my $to_check = param( "shortsequence" ); $to_check = lc $to_check; if ( $sequence =~ /$to_check/ ) { print "Found. The EMBL data extract contains: <b>$to_check</b>."; } else print "Sorry. No match found for: <b>$to_check</b>."; print p, hr,p; print "Press <b>Back</b> on your browser to try another search."; print end_html;

A Search HTML Page <HTML> <HEAD> <TITLE>Search the Sequence for a Match</TITLE> </HEAD> <BODY> Please enter a sequence to match against:<p> <FORM ACTION="/cgi-bin/match_emblCGI"> <p> <textarea name="shortsequence" rows="4" cols="60"></textarea> </p> <input type="reset" value="Clear"> <input type="submit" value="Try it!"> </FORM> </BODY> </HTML>

The ``Search the Sequence for a Match'' web page figMERSEARCH.eps

Installing CGIs on a Web Server $ su $ cp mersearch.html /var/www/html $ cp match_emblCGI /var/www/cgi-bin $ chmod +x /var/www/cgi-bin/match_emblCGI $ cp embl.data.out /var/www/cgi-bin $ <Ctrl-D>

The ``Results of your search are in!'' web page figMERSEARCHFOUND.eps

The ``Sorry! Not Found'' web page figMERSEARCHSORRY.eps

Using a HERE document print <<MERFORM; Please enter another sequence to match against:<p> <FORM ACTION="/cgi-bin/match_emblCGIbetter"> <p> <textarea name="shortsequence" rows="4" cols="60"></textarea> </p> <input type="reset" value="Clear"> <input type="submit" value="Try it!"> </FORM> MERFORM

Better version: ``Results of your search are in!'' web page figMERSEARCHBETTER.eps

Web Databases

Searching all the entries in the dnas table figMERSEARCHMULTI.eps

The ``results'' of the multiple search on the dnas table figMERSEARCHMULTIRESULTS.eps

Installing DB Multi-Search $ su $ cp mersearchmulti.html /var/www/html $ cp db_match_emblCGI /var/www/cgi-bin $ chmod +x /var/www/cgi-bin/db_match_emblCGI $ cp DbUtilsMER.pm /var/www/cgi-bin $ <Ctrl-D>

Where To From Here