Index Bettelheim Bruno Cudowne i pożyteczne O znaczeniach i wartoÂściach baÂśni (5) Eco Umberto Imie Rozy (4) Kybalion John Gray Mezczyzni sa z Marsa a kobiety z Wenus (2) KIT.TXT Nastanie nocy (7) K. J. Yeskov Ostatni Wladca Pierscienia (2) Sandemo Margit Saga O Ludziach Lodu skycan www nie com pl 1 |
[ Pobierz całość w formacie PDF ] .ac.uk/computing/internet/internet-drafts/draft-bahreman-mapplet-spec-00.txt.Z"H-38: Internet Explorer 3.x Vulnerability." (CIAC Advisory)March 4, 1997.http://ciac.llnl.gov/ciac/bulletins/h-38a.shtmlInternet Java & ActiveX Advisor.Journal.http://www.advisor.com/ia.htmJava Developer's Journal.http://www.javadevelopersjournal.com/java/Java Report.Journal.http://www.sigs.com/jro/Javaworld.Journal.http://www.javaworld.com/Gamelan.The ultimate Java archive.http://www-a.gamelan.com/index.shtmlPerlOccasionally, just occasionally, a product emerges from the Internet that is trulymagnificent.Perl is once such product.What started as a small project for LarryWall (Perl's creator) turned into what is likely the most fluid, most easily implementedlanguage ever created.Imagine a programming language that combines some of the very best attributesof languages such as C, sed, awk, and BASIC.Also, remember that the size of Perlprograms are a fraction of what compiled C programs consume.Finally, Perl is almosttoo good to be true for creating CGI applications for use on the WWW.Manipulationof text in Perl is, I think, unrivaled by any computer language.Perl is heavily relied on as a tool for implementing CGI.Like most programmingtools, Perl does not contain many inherent flaws.However, in inexperienced hands,Perl can open a few security holes of its own.Perl and CGICGI is a relatively new phenomenon.It is of significant interest because it offersan opportunity for all programmers to migrate to Web programming.Essentially, CGIcan be done on any platform using nearly any language.The purpose of CGI is to providedynamically built documents and processes to exist on the World Wide Web.Dynamic here means that the result will vary depending on user input.Theresult--usually a newly formed Web page--is generated during the CGI process.Theeasiest way for you to understand this is to examine a Perl script in action.Imaginea Web page with a single form, like the one in Figure 30.4.FIGURE 30.4.The SAMS CGI sample page.The page in Figure 30.4 has a single input field named editbox, whichyou can see within the following HTML source code:<HTML><HEAD><TITLE>SAMS CGI Example</TITLE></HEAD><BODY bgcolor = "#ffffff"><P ></P><P >The Anatomy of a CGI Program</P><P ></P><P ></P><FORM ACTION = "getit.cgi" METHOD = "Get" ><P ><INPUT TYPE = TEXT NAME = "editbox" SIZE = 20 MAXLENGTH = 20></P></FORM></BODY></HTML>Within that code, the form that holds editbox also points to a scriptprogram on the hard drive.That script, called getit.cgi, appears in boldin the following HTML code:<HTML><HEAD><TITLE>SAMS CGI Example</TITLE></HEAD><BODY bgcolor = "#ffffff"><P ></P><P >The Anatomy of a CGI Program</P><P ></P><P ></P><FORM ACTION = "getit.cgi" METHOD = "Get" ><P ><INPUT TYPE = TEXT NAME = "editbox" SIZE = 20 MAXLENGTH = 20></P></FORM></BODY></HTML>So editbox refers to the input box on the form; you assign this nameto the box so that later, when you need to, you can refer to the box (and its contents)as a variable.You know from the preceding code that the contents of editboxwill be sent to a Perl script called getit.cgi.getit.cgi is a very simple Perl script.Its function is to take the inputin editbox, delete from it various codes and strange characters common toHTML, and print the input of editbox on a clean page.The code is as follows:# Print out a content-type for HTTP/1.0 compatibilityprint "Content-type: text/html\n\n";# Get the input from the test HTML formread(STDIN, $buffer, $ENV{`CONTENT_LENGTH'});# Split the name-value pairs@pairs = split(/&/, $buffer);foreach $pair (@pairs){($name, $value) = split(/=/, $pair);# Un-Webify plus signs and %-encoding$value =~ tr/+/ /;$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;$FORM{$name} = $value;}print "$FORM{`editbox'}\n";print "<html>$FORM{`editbox'}\n</html>";Of these lines of code, we are concerned only with the last line.What this linemeans is "Print an entirely new Web page in HTML, and on that page, print theexact same word or words that the user entered into editbox." In thismanner, variables are extracted from an HTML page and run through a Perl script.Naturally, after the variables are extracted, they may be worked over by the programmerin whatever manner the he or she chooses.For example, if the variables consist ofnumbers, the programmer could use Perl to, say, add, multiply, or divide those numbers.After the variables have been extracted, the programmer can do almost anything withthem.The resulting page will be different depending on what the user enters intoeditbox [ Pobierz całość w formacie PDF ] |
||||
Wszelkie Prawa Zastrzeżone! Kawa była słaba i bez smaku. Nie miała treści, a jedynie formę. Design by SZABLONY.maniak.pl. | |||||