• Home
  • Textbooks
  • CGI/Perl (Web Warrior Series)
  • Sending Data Using a Hyperlink

CGI/Perl (Web Warrior Series)

Diane Zak

Chapter 2

Sending Data Using a Hyperlink - all with Video Answers

Educators


Chapter Questions

Problem 1

You can create a link to a CGI script using the HTML anchor tag $(\langle A\rangle)$ together with the tag's_______ property.
a. ALINK
b. AREF
c. HREB
d. HLINK

Check back soon!

Problem 2

Which of the following links the phrase "Click here" to the city.cgi script?
a. KA HREF="http://yourservername/cgi-bin/chap02/city.cgi"> Click here $\langle/ \mathrm{A}\rangle$
b. KA IINK="hteR: /yoyeseryername/cgi-bin/chapo2/city"> Click here $\langle/ \mathrm{A}>$
c. $<$ A fIINK="bftp: /yourservername/cg1-Din/chap02tcity.egi"> ilick hete $>$ A
d. $\mathrm{A}$ / R?EF=/http: / yourservername/cgi-bin/chap02/city.cq is Click bere":<xas

Check back soon!

Problem 3

The output of a CGI script is usually HTML.
a. true
b. false

Check back soon!
01:23

Problem 4

Which of the following statements indicates that a script's output is HTML?
a.$$
\text { ?print "Content-text/html"; }
$$
$$
b. \text { print "Content-type } h t m l / \text { text } \ln \backslash \mathrm{n} \text { "; }
$$
c.print "Content-type: text/html $\backslash \mathbb{M}, \cap)$
d. None of the above.

Vysakh M
Vysakh M
Numerade Educator

Problem 5

Which of the following passes the number 1980 to the age.cgi script?
a. <A HREF="http://yourservername/cgi-bin/chap02/ age.cgikyear=1980">Click here $\langle/ \mathrm{A}\rangle$
b. KA HREF = "http://yourservername/cgi-bin/chap02/ age.cgi?year=1980" >Click here</A>
c.$\{<\mathbb{A}$ HREF="http://yourservername/egi-bin/chap02/ age.cgi year $=1980^{\prime \prime}>\mathrm{Cl}$ ick here $\langle/ \mathrm{A}\rangle$
d. None of the aboye.

Check back soon!

Problem 6

Which oi the following can be used in a script to send the BODY tag to the browser?
a . prYnt ‘-be BOPT > \ n-
b. print <BODY>'vnT'
c. print "<BODV $>$ ln; "
d. print "<BODY>\n"j

Check back soon!

Problem 7

You use the statement ____________CGI.pm module.to import the standard features of the
a. use CGI.pm qw( rstandard)
'b. use CGI qwfstandard) ;
c. use CGI "(standard)";
d. None of the above.

Check back soon!
00:57

Problem 8

When an item of data is sent to a script, the rates the item's $k e y$ from its wilue. character sepa-
a. ampersand $(\&)$
b. qual $\operatorname{sign}(=)$
C. plus sign $(+)$
d. question mark (?)

Aayush Gupta
Aayush Gupta
Numerade Educator

Problem 9

When using a link to send data to a script, you use the_______ character to separate tho URL from the data.
a. ampersand (&)
b. equal sing (=)
c. plus sign (+)
d. eual mark (?)

Check back soon!

Problem 10

When sending multiple items of data to a script, the character separates one item from the_____________ next item.
a. ampersand (&)
b. equal sing (=)
c. plus sign (+)
d. eual mark (?)

Check back soon!
00:49

Problem 11

Each iter of data sent to a script contains two elements: a___________and__________a

Wesley Hines
Wesley Hines
Numerade Educator

Problem 12

If you are using; a link to send a value that contains a space, you replace the space with a________

Check back soon!

Problem 13

The_________uveamodule contains a routine that automatically parses the data received by a script.

Check back soon!

Problem 14

Assume an HTML document contains the tag <A HREF= " http: // yourservername/cgi-bin/chap02/pay. cgi">Click here<BR>. Modify the tag so that it passes a pay rate to the script. Use “pay” as the key and 5.75 as the value.

Check back soon!

Problem 15

Modify the HTML tag from Question 14 so that it also passes the department name. Use “dept” as the key and “Accounting” as the value.

Check back soon!
00:13

Problem 16

Modify the HTML tag from Question 15 so that it passes the value “Accounting Department” rather than “Accounting”.

Pammi Eswari
Pammi Eswari
Numerade Educator

Problem 17

The process ofsplitting the data’s key from its value is called ____________

Check back soon!

Problem 18

The_______________pragma tells the CGI.pm module to pause the execution of a script to allow you to enter information from the keyboard.

Check back soon!

Problem 19

The___________function tells the Perl interpreter to treat the word within the parentheses that follow the function as though the word were entered in single quotation marks.

Check back soon!

Problem 20

You use the CGI.pm module’s_____________function to access the value associated with a key.

Check back soon!