⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch13.htm

📁 美国Macmillan出版社编写的Perl教程《Perl CGI Web Pages for WINNT》
💻 HTM
📖 第 1 页 / 共 5 页
字号:
<HTML>

<HEAD>

<title>The Goo Goo Records Shop - Come On In!</title>

</HEAD>

<BODY bgcolor="#40E0D0" Text="#191970" >

<META Name="keywords" Content="music, sound clips, video clips, avi, wav, alternative,

underground, punk, pop music, funk, contests, prizes"><p>

<center>

<img src="shop.gif">

<p>

<FORM METHOD="POST" ACTION="sales.cgi">

<b>The Gear

<p>

<table border=0>

<tr><td>Item</td><td>U.S. Price</td>

<td>Europe</td><td>RoW</td><td>Quantity Required</td><tr>

<tr><td>Googoo Ski Hat</td>

<td>$14.50</td><td>$15.50</td><td>$16.50</td>

<td><INPUT TYPE="text" NAME="hats" SIZE="2"></td>

</tr>

<tr><td>Googoo Dispatch Bag</td>

<td>$24.00</td><td>$25.00</td><td>$27.50</td>

<td><INPUT TYPE="text" NAME="dispbag" SIZE="2"></td>

</tr>

<tr><td>Googoo Record Bag</td>

<td>$20.00</td><td>$21.00</td><td>$24.50</td>

<td><INPUT TYPE="text" NAME="recbag" SIZE="2"></td>

</tr>

<tr><td>Googoo T-Shirt: Grey on white</td>

<td>$16.00</td><td>$17.00</td><td>$19.00</td>

<td><INPUT TYPE="text" NAME="tsgow" SIZE="2"></td>

</tr>

<tr><td>Googoo T-Shirt: Grey on black</td>

<td>$16.00</td><td>$17.00</td><td>$19.00</td>

<td><INPUT TYPE="text" NAME="tsgob" SIZE="2"></td>

</tr>

<tr><td>Googoo T-Shirt: Black on grey</td>

<td>$16.00</td><td>$17.00</td><td>$19.00</td>

<td><INPUT TYPE="text" NAME="tsbog" SIZE="2"></td>

</tr>

<tr><td>Single Googoo Slipmat</td>

<td>$6.00</td><td>$7.00</td><td>$7.50</td>

<td><INPUT TYPE="text" NAME="oneslip" SIZE="2"></td>

</tr>

<tr><td>Pair Of Googoo Slipmats</td>

<td>$10.00</td><td>$11.00</td><td>$11.50</td>

<td><INPUT TYPE="text" NAME="pairslip" SIZE="2"></td>

</tr> 

</table>

<p>

<img src="record.gif">

<p>

The Records

<p>

<table border=0>

<tr><td>Artist/Title</td><td>Cat.</td><td>U.S. Price</td>

<td>Europe</td><td>RoW</td><td>Quantity Required</td><tr>

<tr><td>Petite Fauves/First Bite Vol 1</td>

<td>Loo 2</td>

<td>$5.00</td><td>$6.50</td><td>$7.00</td>

<td><INPUT TYPE="text" NAME="xx1" SIZE="2"></td>

</tr>

<tr><td>Ten Days Late/Maiden Voyage EP</td>

<td>Load 4</td>

<td>$5.00</td><td>$6.50</td><td>$7.00</td>

<td><INPUT TYPE="text" NAME="xx2" SIZE="2"></td>

</tr>

<tr><td>Suggestive/Advances</td>

<td>Load 6</td>

<td>$5.00</td><td>$6.50</td><td>$7.00</td>

<td><INPUT TYPE="text" NAME="xx3" SIZE="2"></td>

</tr>

<tr><td>Push Up/Heartbreaker</td>

<td>Load 9</td>

<td>$5.00</td><td>$6.50</td><td>$7.00</td>

<td><INPUT TYPE="text" NAME="xx4" SIZE="2"></td>

</tr>

<tr><td>Petite Fauves/First Bite Vol 3 pt 1</td>

<td>Load 10</td>

<td>$5.00</td><td>$6.50</td><td>$7.00</td>

<td><INPUT TYPE="text" NAME="xx5" SIZE="2"></td>

</tr>

<tr><td>Petite Fauves/First Bite Vol 3 pt 2</td>

<td>Load 11</td>

<td>$5.00</td><td>$6.50</td><td>$7.00</td>

<td><INPUT TYPE="text" NAME="xx6" SIZE="2"></td>

</tr>

<tr><td>Seoul Train/Viper Room EP</td>

<td>Load 13</td>

<td>$5.00</td><td>$6.50</td><td>$7.00</td>

<td><INPUT TYPE="text" NAME="xx7" SIZE="2"></td>

</tr>

<tr><td>Petite Fauves/First Bite Vol 4</td>

<td>Load 14</td>

<td>$5.00</td><td>$6.50</td><td>$7.00</td>

<td><INPUT TYPE="text" NAME="xx8" SIZE="2"></td>

</tr>

<tr><td>Jism/Gravity</td>

<td>Load 18</td>

<td>$5.00</td><td>$6.50</td><td>$7.00</td>

<td><INPUT TYPE="text" NAME="xx9" SIZE="2"></td>

</tr>

<tr><td>Doodle Tool/Let It Be</td>

<td>Load 19</td>

<td>$5.00</td><td>$6.50</td><td>$7.00</td>

<td><INPUT TYPE="text" NAME="xx10" SIZE="2"></td>

</tr>

<tr><td>Tired Eyes/Eat Muff</td>

<td>Load 22</td>

<td>$5.00</td><td>$6.50</td><td>$7.00</td>

<td><INPUT TYPE="text" NAME="xx11" SIZE="2"></td>

</tr>

<tr><td>Jism/Blue Fish/Who Are Them?  </td>

<td>Load 23  </td>

<td>$5.00</td><td>$6.50</td><td>$7.00</td>

<td><INPUT TYPE="text" NAME="xx12" SIZE="2"></td>

</tr>

<tr><td>Henson's Nuts/Feel Space</td>

<td>Load 25</td>

<td>$5.00</td><td>$6.50</td><td>$7.00</td>

<td><INPUT TYPE="text" NAME="xx13" SIZE="2"></td>

</tr>

<tr><td>Needle Nose/Angry Lemon/BBQ Babies</td>

<td>Load 28</td>

<td>$5.00</td><td>$6.50</td><td>$7.00</td>

<td><INPUT TYPE="text" NAME="xx14" SIZE="2"></td>

</tr>

</table>

<h5>RoW = Rest of the World</h5>

<p>

All prices include postage, packing and handling. Please allow 28 days for delivery in 

the U.S. and 40 days for Europe and the rest of the world.

</center>

<p>

<hr>

</center>

<b>Ordering via email</b>

<pre>

Name         : <INPUT NAME="name" TYPE="TEXT" SIZE="50">

Number/Street: <INPUT NAME="numberstreet" TYPE="TEXT" SIZE="50">

Town/City    : <INPUT NAME="towncity" TYPE="TEXT" SIZE="40">

Post/Zipcode : <INPUT NAME="postcode" TYPE="TEXT" SIZE="12">

Country      : <INPUT NAME="country" TYPE="TEXT" SIZE="25">

Phone (optional, U.S. only): <INPUT NAME="phone" TYPE="TEXT" SIZE="15">

e-mail address: <INPUT NAME="email" TYPE="TEXT" SIZE="40">

</pre>

<p>

Once we receive your order, we will contact you by phone, or email, to determine your

payment method. To spped you order along, you can call our toll free 800 number:

<p>

<center>1-800-555-5428</center>

<p>

and we will match your online order with your method of payment.

<hr>

To submit your order electronically, press: <INPUT TYPE="submit" VALUE="Send order now"> -

or to clear everything <INPUT TYPE="reset" VALUE="Press this">

<p>

<hr>

<b>Ordering via fax</b>

<p><br>

Fill in this page as for an email order, print it out from your WWW

software (or just write out the relevant details on a piece of paper) and fax it to:

<p>

 (212) 555-7649 

<p>

<hr>

<b>Ordering via normal (postal) (snail) (slow) (boring) mail.</b>

<p><br>

Write your order, remebering all the important details (your address is 

quite useful!) and mail it to us at:

<p>

5423 Irvine Drive<br>

PO Box 10010, Emeryville, CA,<br>

90543<br>

United States<br>

<p>

You can send us a cheque or postal order, crossed in pounds sterling (only),

made payable to GOO GOO RECORDS. Please do not send cash.

<center>

<hr>

</center>

</BODY>

</HTML>

</PRE>

</BLOCKQUOTE>

<P>

To help with the speedy processing of the form, three copies of

the member's data are sent via e-mail to Goo Goo Records Central.

A copy is sent to the sales department (sales@googoo.com), so

that they may record the sale; the warehouse (warehouse@googoo.com),

so that the order can be filled, and accounting (accounts@googoo.com),

so that the proper invoices can be issued. This greatly reduces

the interoffice paperwork as well as the time necessary to make

delivery. 

<P>

The script that handles the data from this order form looks something

like this:

<BLOCKQUOTE>

<PRE>

#!/usr/bin/perl



if ($ENV{'REQUEST_METHOD'} EQ 'POST') {

	read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});

	@pairs=split(/&amp;/, $buffer);



# This is the Name-Value pair splitter.. Put into $FORM array



	foreach $pair (@pairs) {



		($name,$value)=split(/=/,$pair);

		$value=~tr/+/ /;

		$value=~s/%([a-fA-F0-9][a-fA-F0-9])/pack(&quot;C&quot;,hex($1))/eg;

		$FORM{$name}=$value;

	}



	open(MAIL, &quot;|mail sales\@www.googoo.com&quot;);

	&amp;pform;

	close(MAIL);

	open(MAIL, &quot;|mail accounting\@www.googoo.com&quot;);

	&amp;pform;

	close(MAIL);

	open(MAIL, &quot;|mail warehouse\@www.googoo.com&quot;);

	&amp;pform;

	close(MAIL);

	if ($FORM{email}) {

		open(MAIL, &quot;|mail $FORM{email}&quot;);

		&amp;pform;

		close(MAIL);

	}





	print &quot;Content-type: text/html\n\n&quot;;

	print &lt;&lt;EOF;

&lt;HTML&gt;

&lt;HEAD&gt;

&lt;TITLE&gt;Thank you for your order!&lt;/TITLE&gt;

&lt;/HEAD&gt;

&lt;BODY&gt;

&lt;H1&gt;Thank you for your order!&lt;/H1&gt;

&lt;HR&gt;

A copy of your order form has been sent to the appropriate people for

processing

and a copy has been sent to your e-mail address for your records.  A GooGoo

representative will contact you shortly regarding your payment method.



&lt;/BODY&gt;

&lt;/HTML&gt;

EOF



}



else {

        print &quot;&lt;HTML&gt;\n&quot;;

        print &quot;&lt;title&gt;Error - Form Error&lt;/title&gt;\n&quot;;

        print &quot;&lt;h1&gt;Error: Form Error&lt;/h1&gt;\n&quot;;

        print &quot;&lt;P&gt;&lt;hr&gt;&lt;P&gt;\n&quot;;

        print &quot;There was an error with the form submission. Please\n&quot;;

        print &quot;contact Imprint at &lt;address&gt;&lt;a

href=\&quot;mailto:web@imprint.uwaterloo.ca\&quot;&gt;web@imprint.uwaterloo.ca&lt;/a&gt;&lt;/address&gt;\n&quot;;

        print &quot;&lt;/HTML&gt;\n&quot;;

	exit;

}



sub pform {



	print MAIL &quot;Subject: Order form\n&quot;;

	print MAIL &quot;\nThe following is an order form received on the Web.\n&quot;;

	print MAIL &quot;\nRequested by:\n\n&quot;;

	print MAIL &quot;\t$FORM{name}\n&quot;;

	print MAIL &quot;\t$FORM{numberstreet}\n&quot;;

	print MAIL &quot;\t$FORM{towncity}\n&quot;;

	print MAIL &quot;\t$FORM{postcode}\n&quot;;

	print MAIL &quot;\t$FORM{phone}\n&quot;;

	print MAIL &quot;\t$FORM{email}\n&quot;;

	print MAIL &quot;\nMisc Items:\n\n&quot;;

	print MAIL &quot;\tHats\t\t\t\t$FORM{hats}\n&quot; if $FORM{hats};

	print MAIL &quot;\tGoogoo Bag\t\t\t$FORM{dispbag}\n&quot; if $FORM{dispbag};

	print MAIL &quot;\tRecord Bag\t\t\t$FORM{recbag}\n&quot; if $FORM{recbag};

	print MAIL &quot;\tT-shirt (G on W)\t\t$FORM{tsgow}\n&quot; if $FORM{tsgow};

	print MAIL &quot;\tT-shirt (G on B)\t\t$FORM{tsgob}\n&quot; if $FORM{tsgob};

	print MAIL &quot;\tT-shirt (B on G)\t\t$FORM{tsbog}\n&quot; if $FORM{tsbog};

	print MAIL &quot;\t1xSlipmat\t\t\t$FORM{oneslip}\n&quot; if $FORM{oneslip};

	print MAIL &quot;\t2xSlipmat\t\t\t$FORM{pairslip}\n&quot; if $FORM{pairslip};

	print MAIL &quot;\nAlbums:\n\n&quot;;

	print MAIL &quot;\tPetite Fauves/First Bite Vol 1\t\t\t$FORM{xx1}\n&quot; if

$FORM{xx1};

	print MAIL &quot;\tTen Days Late/Maiden Voyage EP\t\t\t$FORM{xx2}\n&quot; if

$FORM{xx2};

	print MAIL &quot;\tSuggestive/Advances\t\t\t\t$FORM{xx3}\n&quot; if $FORM{xx3};

	print MAIL &quot;\tPush Up/Heartbreaker\t\t\t\t$FORM{xx4}\n&quot; if

$FORM{xx4};

	print MAIL &quot;\tPetite Fauves/First Bite Vol 3 pt 1\t\t\t$FORM{xx5}\n&quot; if

$FORM{xx5};

	print MAIL &quot;\tPetite Fauves/First Bite Vol 3 pt 2\t\t\t$FORM{xx6}\n&quot; if

$FORM{xx6};

	print MAIL &quot;\tSeoul Train/Viper Room EP\t\t\t$FORM{xx7}\n&quot; if

$FORM{xx7};

	print MAIL &quot;\tPetite Fauves/First Bite Vol 4\t\t\t$FORM{xx8}\n&quot; if

$FORM{xx8};

	print MAIL &quot;\tJism/Gravity\t\t\t\t$FORM{xx9}\n&quot; if

$FORM{xx9};

	print MAIL &quot;\tDoodle Tool/Let It Be\t\t\t$FORM{xx10}\n&quot; if

$FORM{x10};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -