cgi and perl - basics

11
CGI and Perl - Basics Please use speaker notes for additional information!

Upload: thadeus-atalo

Post on 31-Dec-2015

51 views

Category:

Documents


3 download

DESCRIPTION

CGI and Perl - Basics. Please use speaker notes for additional information!. Note that the param(‘dept’) could have been written as param(“dept”). - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: CGI and Perl - Basics

CGI and Perl - Basics

Please use speaker notes for additional information!

Page 2: CGI and Perl - Basics

Note that the param(‘dept’) could have been written as param(“dept”).

Page 3: CGI and Perl - Basics
Page 4: CGI and Perl - Basics
Page 5: CGI and Perl - Basics
Page 6: CGI and Perl - Basics

I put the dept.html code and the spruce.gif image in the begin subdirectory/folder under the public_html directory/folder. Note that I mirror the setup on my hard drive to help me keep a structure to what I am doing.

Page 7: CGI and Perl - Basics

I put the dept.cgi in the begin subdirectory/folder under the cgi-bin directory/older.

Page 8: CGI and Perl - Basics
Page 9: CGI and Perl - Basics
Page 10: CGI and Perl - Basics

<!spemp.html><html><head><title>Spruce Department Store</title></head><body><div align=center><h1>Spruce Department Store</h1><img src="spruce.gif"><br><br></div><h2>Select an employee to get more information:</h2><font size=4><a href="http://www.pgrocer.com/cgi-bin/begin/spemp.cgi?emp=John+Smith&title=clerk">Smith</a><br><a href="http://www.pgrocer.com/cgi-bin/begin/spemp.cgi?emp=Susan+Ash&title=manager">Ash</a><br><a href="http://www.pgrocer.com/cgi-bin/begin/spemp.cgi?emp=Donald+Costa&title=accountant">Costa</a><br><a href="http://www.pgrocer.com/cgi-bin/begin/spemp.cgi?emp=Jane+Anderson&title=clerk">Anderson</a><br><a href="http://www.pgrocer.com/cgi-bin/begin/spemp.cgi?emp=Patricia+Sousa&title=buyer">Sousa</a><br><a href="http://www.pgrocer.com/cgi-bin/begin/spemp.cgi?emp=Robert+Parker&title=supervisor">Parker</a><br></font></body></html>

Page 11: CGI and Perl - Basics

#!/usr/bin/perl#another example of cgi and perlprint "Content-type: text/html\n\n";use CGI qw(:standard);print "<html>\n";print "<head><title>Spruce Department Store</title><basefont size=4></head>\n";print "<body>\n";print "<h1>Employees of Spruce Department Store</h1>\n";print "Employee: ", param('emp'), " Title: ", param('title'), "\n";print "</body>\n";print "</html>\n";