1 / 11

CGI and Perl - Basics

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

Télécharger la présentation

CGI and Perl - Basics

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

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

  3. 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.

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

  5. <!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>

  6. #!/usr/bin/perl #another example of cgi and perl print "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";

More Related