From owner-freebsd-questions Mon Mar 30 21:31:18 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id VAA21432 for freebsd-questions-outgoing; Mon, 30 Mar 1998 21:31:18 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from www.dcoisp.net (www.dcoisp.net [208.128.192.228]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id VAA21425 for ; Mon, 30 Mar 1998 21:31:09 -0800 (PST) (envelope-from ringlord@www.dcoisp.net) Received: (qmail 12479 invoked by uid 1002); 30 Mar 1998 10:47:46 -0000 Date: Mon, 30 Mar 1998 10:47:46 +0000 (GMT) From: "Jeremy D. Hartley" To: freebsd-questions@FreeBSD.ORG Subject: Could I please get some help on a cgi script? Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Greetings. First off, I know that cgis are not the topic of freebsd list usually. I have however had really good luck from many folks on this list, and I am really in a bit of a jam, and any help I can get would be greatly appreciated. Over the last several days, I have been given the task of creating a huge website by next week, and it requires a lot of learning things on the fly. Anyway, I have been teaching myself cgi writing, in perl. I am including the text of the cgi script in the body of the message, along with the html form I have created. It is inportant to note that the form seems to work correctly, after I pointed the action attribute to the test cgis on ncsa's webserver. However, my cgi seems to return every value except the last one! That is where the problem is, and I am hoping someone can assist me. CGI script: #!/usr/bin/perl &readparse; print "Content-type:text/html\n\n"; print "Form results
"; print "The information you submitted is included below.
"; print "In order to complete your order, please print and send this form and send it to us."; $firstname = $value[0]; $lastname = $value[1]; $address1 = $value[2]; $address2 = $value[3]; $city = $value[4]; $state = $value[5]; $zip = $value[6]; $phone = $value[7]; $fax = $value[8]; $email = $value[9]; $comments = $value[10]; $single = $value[11]; $double = $value[12]; $tripple = $value[13]; $grand = $value[14]; $sports = $value[15]; print "First name: $firstname
"; print "Last name: $lastname
"; print "Address: $address1
"; print "$address2
"; print "City: $city
"; print "State: $state
"; print "zip is: $zip
"; print "Phone: $phone
"; print "fax: $fax
"; print "e-mail: $email
"; print "comments: $comments
"; print "plan: $single $double $tripple $grand
"; print "sports: $sports
"; sub readparse { read(STDIN,$user_string,$ENV{'CONTENT_LENGTH'}); if (length($ENV{'QUERY_STRING'})>0) {$user_string=$ENV{'QUERY_STRING'}}; $user_string =~ s/\+/ /g; @name_value_pairs = split(/&/,$user_string); foreach $name_value_pair (@name_value_pairs) { ($keyword,$value) = split(/=/,$name_value_pair); $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/ge; push(@value, "$value"); $user_data{$keyword} = $value; } } HTML form: Join the Informer Today!

Join the Fantasy Sports Informer Today!

Here at FSI, we give you many ways to participate in the sports you love.
If you wish to pay with your Visa or Mastercard, more information is availible by clicking here.

Folks wishing to pay by check or money order may do so by completely filling out the form below.
After you complete the form, a copy will be e-mailed to the address you specified on the form. Simpley print out the completed form and send it to the address provided when you submit the form to us.

ORDER FORM



First name:
Last name:
Street address, line 1:
Street address, line 2:
City:
Enter your 2 letter state code (CA California)
Enter your Zip or postal code:
Phone number (777-555-1212)
Fax number: (777-555-1212)
E-mail address:
Where did you hear about us?

CHOOSE YOUR PLAN

Which of the four plans do you wish to signup for? Single Sport Doubleplay two sport plan


Trippleplay 3 sport plan
Grandslam 4 sport plan
What other sports do you like?



To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message