CS120 The Information Era TOPICS: CGI-Scripts 4/18/05

Slides:



Advertisements
Similar presentations
Social Web Design 1 Darby Chang Social Web Design.
Advertisements

CIS101 Introduction to Computing Week 08. Agenda Your questions JavaScript text Resume project HTML Project Six This week online Next class.
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.
16/19/2015CS120 The Information Era CS120 The Information Era Chapter 5 – Advanced HTML TOPICS: Introduction to Web Page Forms and Introductory Javascript.
Personal Independent Networking Project HTML Forms by Chris Smith.
Defined/Undef my $i; if( defined $i ) #false $i=0; if( defined $i ) #true my %hash; #or %hash=(); defined %hash; #false, hash is empty $hash{“1”}=“one”;
CGI Programming: Part 1. What is CGI? CGI = Common Gateway Interface Provides a standardized way for web browsers to: –Call programs on a server. –Pass.
1 CS101 Introduction to Computing Lecture 12 Interactive Forms (Web Development Lecture 4)
Interactive Form 1 Edited By; L.Maha AlAjmi. Revision 2 We learnt how to extend our Web pages by adding a few more tags Specifically, we discussed various.
CGI Common Gateway Interface. CGI is the scheme to interface other programs to the Web Server.
Let’s Make An Form! Bonney Armstrong GD 444 Westwood College February 9, 2005.
1 VU. 2 CS101 Introduction to Computing Lecture 15 More on Interactive Forms (Web Development Lecture 5)
2 1 Sending Data Using a Hyperlink CGI/Perl Programming By Diane Zak.
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";
Python CGI programming
Introduction to Programming the WWW I CMSC Summer 2004 Lecture 6.
Data files using cgi/perl Please use speaker notes for additional information!
HTML Forms. Today’s Lecture We will try to understand the utility of forms on Web pages We will find out about the various components that are used in.
CGI Programming. What is "CGI"? Common Gateway Interface A means of running an executable program via the Web. CGI is not a Perl-specific concept. Almost.
Chapter 9: Perl and CGI Programming CGI Programming Acknowledgement: Some materials are taken from Teach Yourself CGI Programming with PERL 5 in a Week.
JavaScript. During the last lecture We looked at the utility of forms on Web pages We found out about the various components that are used in a form We.
1 HTML Forms
HTML : Forms, Frames Instructor: Mr. Ahmed Al Astal ITGD4104 Department Requirement for senior student University of Palestine Faculty of IT.
ITCS373: Internet Technology Lecture 5: More HTML.
CSC 2720 Building Web Applications Server-side Scripting with PHP.
1 HTML Forms
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
Sending data, forms and variables Please use speaker notes for additional information!
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
Accessing the Lab. Putty Available via links on course page Creates secure (SSH) command line session between your machine and SCS network Uses tunnelling.
Starting BBEdit or Notepad and Opening the HTML File Start BBEdit or Notepad Select Open from the File Menu Open survey1.htm from the Public Folder.
1 HTML forms (cont.)
 2001 Prentice Hall, Inc. All rights reserved. Chapter 7 - Introduction to Common Gateway Interface (CGI) Outline 7.1Introduction 7.2A Simple HTTP Transaction.
Chapter 16 Web Pages And CGI Scripts Department of Biomedical Informatics University of Pittsburgh School of Medicine
CS 330 Class 8 Homework A pattern that contains a word with an optional period A pattern that contains Fred with a space (not Freddy) See regexp.txt guest4.htm.
HTML And the Internet. HTML and the Internet ► HTML: HyperText Markup Language  Language in which all pages on the web are written  Not Really a Programming.
Week-11 (Lecture-1) Introduction to HTML programming: A web based markup language for web. Ex.
Sending data with CGI/Perl Please use speaker notes for additional information!
Lesson 11. CGI CGI is the interface between a Web page or browser and a Web server that is running a certain program/script. The CGI (Common Gateway Interface)
University of Kansas Department of Electrical Engineering and Computer Science Dr. Susan Gauch April 21, 2005 I T T C Introduction to Web Technologies.
© 2004 D. J. Foreman T&F-1 CS205 Tables & Forms. T&F-2 ©2007 D. J. Foreman Tables.
1 After completing this lesson, you will be able to: Create and edit hyperlinks in worksheets. Save worksheets and workbooks as Web pages. Send workbooks.
Chapter 7 - Introduction to Common Gateway Interface (CGI)
Web Development Part 2.
HTML Basics (Part-3).
CSE 102 Introduction to Web Design and Programming
CGI I: Basics Web Programming.
Executing Server-Side Scripts
Using the Internet to publish data and applications
HTML Forms CSC 102 Lecture.
Introduction to Programming the WWW I
CS120 The Information Era Chapter 4 – More HTML Specifics
Simple PHP application
HTML: Basic Tags & Form Tags
Perl Web Page – Just Enough
CGI Programming Part II UNIX Security
HTML and CSS MIS 2402 Jeremy Shafer Department of MIS
HTTP GET vs POST SE-2840 Dr. Mark L. Hornick.
Creating Forms on a Web Page
What is Perl? PERL--Practical Extraction and Report Language
Adding information to provider pages
Journal of Mountain Science (JMS)
An Example of a TCP/IP Application: the World Wide Web
CS205 Tables & Forms © 2012 D. J. Foreman.
CS205 Tables & Forms © 2008 D. J. Foreman.
CGI I: Basics Web Programming.
CS205 Tables & Forms © 2004 D. J. Foreman.
Making your HTML Page Interactive
CGI II: Cookies & Stuff Web Programming.
HTML: Basic Tags & Form Tags
Presentation transcript:

CS120 The Information Era TOPICS: CGI-Scripts 4/18/05

CGI-Scripts Last week we wrote and ran our first CGI script What steps did we take to get the script up and running? 4/18/05 CS120 The Information Era

Scripts and Forms Recall that forms are created <FORM METHOD=GET ACTION="URL”> <INPUT TYPE="text" NAME="name" SIZE="20" VALUE="Your name"> </FORM> To combine forms and scripts we need to put the url of the script in the action attribute 4/18/05 CS120 The Information Era

Example Create the following CGI script using the same steps we used last time #!/usr/bin/perl -wT use CGI qw(:standard); use CGI::Carp qw(warningsToBrowser fatalsToBrowser); use strict; print header; print start_html("Get From"); my %form; foreach my$p (param()) { $form{$p} = param($p); print "$p : $form{$p}<br>\n"; } print end_html; 4/18/05 CS120 The Information Era

Script Don’t forget to change the permissions on the file chmod 755 filename 4/18/05 CS120 The Information Era

Html Page Create the following html page <html><head><title>Test Form</title></head> <body> <form action="display.cgi" method="GET"> First Name: <input type="text" name="firstname" size=30><br> Last Name: <input type="text" name="lastname" size=30><br> <input type="submit"><p> </form> </body></html> 4/18/05 CS120 The Information Era

Scripts Scripts can also be used to display html as well as simple text #!/usr/bin/perl print "Content-type: text/html\n\n"; print "<html>"; print "<head>"; print "Sports Authority"; print "</head>"; print "<body bgcolor=blue>"; print "<center><h3><font color=FFFFFF>Thank you for signing up for the mailing list. In a couple of days you will recieve all information regarding discounts via email. Please browse the rest of our website.</font></h3></center>"; print "</body>"; print "</html>"; 4/18/05 CS120 The Information Era

Problem Write a CGI script that will display the message below in red on a black background Your exam has been submitted You should receive your results within 15 days Write an html page that contains a button, and when clicking on the button, the above script will be called 4/18/05 CS120 The Information Era