[17265] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 4687 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Oct 21 21:10:22 2000

Date: Sat, 21 Oct 2000 18:10:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <972177009-v9-i4687@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sat, 21 Oct 2000     Volume: 9 Number: 4687

Today's topics:
    Re: still need help/beginner....pulling my hair ! <mahnke@fliegen-ist-schoener.de>
    Re: still need help/beginner....pulling my hair ! <none@nospam.com>
    Re: still need help/beginner....pulling my hair ! <uri@sysarch.com>
    Re: still need help/beginner....pulling my hair ! <mtaylorlrim@my-deja.com>
    Re: Using text file to display form data <mahnke@fliegen-ist-schoener.de>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sun, 22 Oct 2000 01:28:32 +0100
From: "Christian Mahnke" <mahnke@fliegen-ist-schoener.de>
Subject: Re: still need help/beginner....pulling my hair !
Message-Id: <8st8em$k8u$04$1@news.t-online.com>

Hello,

I don't have a good solution for this but I think I can tell you what
happend. Since all of your Checkbuttons have the name "toppings", you have
only one topping entry in the hash %input (as far as I know hashes can only
have one entry with the same name), regardless of how many Checkboxes you
checked.

I would check the value of $input{toppings} if you checked more than one
checkbox. If it has more than one value an is serperated by spaces, for
example, you could use something like this
@toppings = split /\s/, $input{toppings}; # /s is the seperator, in this
case a space
$count = scalar @toppings;

Hope this helps,

cheers,

Christian

°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
Fliegen-ist-Schoener.de
http://www.fliegen-ist-schoener.de
mahnke@fliegen-ist-schoener.de
Tel: 0179-5304585
°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
in-House Partner:
http://www.billiger-telefonieren.de/ ~ http://www.stromseite.de/
http://www.billiger-surfen.de/ ~ http://www.tvinfo.de/
http://www.billiger-versichern.de/ ~ http://www.booklooker.de/
http://www.sms.de/ ~ http://www.movil24.com/
°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°

"none" <none@nospam.com> schrieb im Newsbeitrag
news:2TnI5.1990$bM2.1631@newsfeed.slurp.net...
> All this has to do is COUNT the freakin numer of boxes that were checked
for
> toppings - all it ever shows is 1.  I've tried everything, including
adding
> spaces after the topping value in the form, etc.  Anyway to get this to
> work, I've only wasted around 4 hours on it.
>
> Thanks. (see bottom part of program for 'toppings' - that's what I'm
trying
> to count) also in sub order_form_pizza you can see where I am mixing and
> matching values (with space, with comma, without, etc) trying to get
> something to work.  None of it does.  $test has a value of 1 when I
display
> it.  aline,s1line,sline,toptot are all blank.
>
>
> ------------------------------
>
> #!c:\perl\bin\perl.exe
> # This is pizzahome.pl
>
> require 'cgi-lib.pl';
>
> $now = localtime;
>
> &ReadParse(*input);
>
> print "Content-type: text/html\n\n";
>
> if ($input{form} eq "form_1") {
>    &name_address_form;
> } elsif ($input{form} eq "form_2") {
>    &order_form_pizza;
> } elsif ($input{form} eq "form_3") {
>    &order_form_payment;
> } elsif ($input{form} eq "form_4") {
>    &order_form_thanks;
> } else {
>    &name_address_form;
> }
>
>
> sub name_address_form
> {
>  print qq~
>  <html>
>  <head>
>    <title>Perfect Pizza Order Form: Name and Address</title>
>  </head>
>  <body>
>    <h2>Perfect Pizza Order Form: Name and Address</h2>
>    <p>Please enter your name, address and phone number below</p>
>
>    <form action="/cgi-bin/pizzaorder.pl" method="post">
>      <input type="hidden" name="form" value="form_2">
>      <table border="0">
>        <tr><td>Name:</td>
>            <td><input type="text" name="name"></td></tr>
>        <tr><td>Address:</td>
>            <td><input type="text" name="address"></td></tr>
>        <tr><td>Phone:</td>
>            <td><input type="text" name="phone"></td></tr>
>        <tr><td></td>
>            <td><input type="submit" value="Continue">
>                <input type="reset" value="Clear Form"></td></tr>
>      </table>
>    </form>
>   </body>
>   </html>~;
> } # end of entering name and address
>
> sub order_form_pizza
> {
>   print qq~
>  <html>
>   <head>
>     <title>Perfect Pizza Order Form: Pizza</title>
>   </head>
>   <body>
>   <h2>Perfect Pizza Order Form: Pizza</h2>
>   <p>Please customize your pizza below.</p>
>
>   <form action="/cgi-bin/pizzaorder.pl" method="post">
>     <input type="hidden" name="form" value="form_3">
>     <input type="hidden" name="name" value="$input{name}">
>     <input type="hidden" name="address" value="$input{address}">
>     <input type="hidden" name="phone" value="$input{phone}">
>     <table border="0">
>       <tr><td>What size pizza would you like?<p></td></tr>
>       <tr><td><input type="radio" name="pizzasize" value="Small">Small<br>
>               <input type="radio" name="pizzasize"
value="Medium">Medium<br>
>               <input type="radio" name="pizzasize" value="Large"
> checked>Large<br>
>               <input type="radio" name="pizzasize"
> value="X-Large">X-Large<p></td></tr>
>
>       <tr><td>Which toppings would you like? (All pizzas include cheese
and
> tomato sauce)<p></td></tr>
>       <tr><td><input type="checkbox" name="toppings" value="X-Cheese,
> ">Extra Cheese<br>
>               <input type="checkbox" name="toppings" value="Pepperoni,
> ">Pepperoni<br>
>               <input type="checkbox" name="toppings" value="Sausage,
> ">Sausage<br>
>               <input type="checkbox" name="toppings"
value="Onion">Onion<br>
>               <input type="checkbox" name="toppings"
> value="Anchovy">Anchovy<br>
>               <input type="checkbox" name="toppings"
> value="Mushroom">Mushroom<br>
>               <input type="checkbox" name="toppings" value="Ham">Ham<br>
>               <input type="checkbox" name="toppings"
> value="Pineapple">Pineapple<br>
>               <input type="checkbox" name="toppings"
> value="GreenPeppers">Green Peppers<br>
>               <input type="checkbox" name="toppings"
> value="JalepenoPeppers">Jalepeno Peppers<p></td></tr>
>
>        <tr><td>Additional Comments:</td></tr>
>        <tr><td><input type="text" name="comments" size="20"
> maxlength="30"><p></td></tr>
>        <tr><td><input type="submit" value="Continue">
>                <input type="reset" value="Clear Form"></td></tr>
>     </table>
>   </form>
>
>   </body>
>   </html>~;
>
>
> } # end of entering pizza selection
>
> sub order_form_payment
> {
>   print qq~
>  <html>
>   <head>
>     <title>Perfect Pizza Order Form: Payment</title>
>   </head>
>   <body>
>   <h2>Perfect Pizza Order Form: Payment</h2>
>   <p>Please select your payment option below.</p>
>
>   <form action="/cgi-bin/pizzaorder.pl" method="post">
>     <input type="hidden" name="form" value="form_4">
>     <input type="hidden" name="name" value="$input{name}">
>     <input type="hidden" name="address" value="$input{address}">
>     <input type="hidden" name="phone" value="$input{phone}">
>     <input type="hidden" name="pizzasize" value="$input{pizzasize}">
>     <input type="hidden" name="toppings" value="$input{toppings}">
>     <input type="hidden" name="comments" value="$input{comments}">
>
>     <table border="0">
>       <tr><td><input type="radio" name="payment" value="pickup">Pick-Up
(No
> Delivery)<p>
>               <input type="radio" name="payment" value="COD"
> checked>Cash/Check<p>
>               <input type="radio" name="payment" value="charge">Charge
>               <select name="chargetype" size="1">
>                 <option value="visa">Visa
>                 <option value="mc">Master Card
>                 <option value="amex">American Express
>               </select>
>           Card Number:<input type="text" name="cardnumber" size="20"
> maxlength="30"><p></td></tr>
>        <tr><td><input type="submit" value="Continue">
>                <input type="reset" value="Clear Form"></td></tr>
>     </table>
>   </form>
>   <input type="hidden" name="payment" value="$input{payment}">
>   <input type="hidden" name="chargetype" value="$input{chargetype}">
>   <input type="hidden" name="cardnumber" value="$input{cardnumber}">
>   </body>
>   </html>~;
> } # end of entering pizza payment
>
> sub order_form_thanks
> {
>   if ($input{pizzasize} eq "Small") {
>       $pizzacost = 7;
>   } elsif ($input{pizzasize} eq "Medium") {
>       $pizzacost = 9;
>   } elsif ($input{pizzasize} eq "Large") {
>       $pizzacost = 10;
>   } else {
>       $pizzacost = 12;
>   }
>
> @line = @$input{toppings};
> $test = @line;
>
> $totalcost = $pizzacost + $toppingtotal;
>
>   print qq~
> <html>
>   <head>
>     <title>Perfect Pizza Order Form: Thanks</title>
>   </head>
>   <body>
>   <h2>Thanks for your order!</h2>
>
>   <table>
>
>     <tr><td>Your pizza will be delivered piping hot in 30 minutes or less.
> If you chose "Pick-Up", your pizza will be ready in about 10
> minutes.</td></tr>
>     <tr>
>   </table>
>
>     test = $test<br>
>     aline = @line<br>
>     s1line = $line[0]<br>
>     sline = $line<br>
>     toptot = $toppingtotal<br>
>     name=$input{name}<br>
>     address=$input{address}<br>
>     phone=$input{phone}<br>
>     pizzasize=$input{pizzasize}<br>
>     toppings=$input{toppings}<br>
>     payment=$input{payment}<br>
>     chargetype=$input{chargetype}<br>
>     cardnumber=$input{cardnumber}<br>
>     total=$totalcost
>     comments=$input{comments}
> <p>
> <a href="/pizzahome.html">Return Home</a>
>  </body>
>   </html>
> ~;
> }
>
>
>
>
>
>
>
>




------------------------------

Date: Sat, 21 Oct 2000 19:50:49 -0400
From: "none" <none@nospam.com>
Subject: Re: still need help/beginner....pulling my hair !
Message-Id: <QPpI5.2200$bM2.3299@newsfeed.slurp.net>

THANKS !  That worked. You are a lifesaver (and a computer saver as I was
going to toss mine out the window).


"Christian Mahnke" <mahnke@fliegen-ist-schoener.de> wrote in message
news:8st8em$k8u$04$1@news.t-online.com...
> Hello,
>
> I don't have a good solution for this but I think I can tell you what
> happend. Since all of your Checkbuttons have the name "toppings", you have
> only one topping entry in the hash %input (as far as I know hashes can
only
> have one entry with the same name), regardless of how many Checkboxes you
> checked.
>
> I would check the value of $input{toppings} if you checked more than one
> checkbox. If it has more than one value an is serperated by spaces, for
> example, you could use something like this
> @toppings = split /\s/, $input{toppings}; # /s is the seperator, in this
> case a space
> $count = scalar @toppings;
>
> Hope this helps,
>
> cheers,
>
> Christian
>
> °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
> Fliegen-ist-Schoener.de
> http://www.fliegen-ist-schoener.de
> mahnke@fliegen-ist-schoener.de
> Tel: 0179-5304585
> °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
> in-House Partner:
> http://www.billiger-telefonieren.de/ ~ http://www.stromseite.de/
> http://www.billiger-surfen.de/ ~ http://www.tvinfo.de/
> http://www.billiger-versichern.de/ ~ http://www.booklooker.de/
> http://www.sms.de/ ~ http://www.movil24.com/
> °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
>
> "none" <none@nospam.com> schrieb im Newsbeitrag
> news:2TnI5.1990$bM2.1631@newsfeed.slurp.net...
> > All this has to do is COUNT the freakin numer of boxes that were checked
> for
> > toppings - all it ever shows is 1.  I've tried everything, including
> adding
> > spaces after the topping value in the form, etc.  Anyway to get this to
> > work, I've only wasted around 4 hours on it.
> >
> > Thanks. (see bottom part of program for 'toppings' - that's what I'm
> trying
> > to count) also in sub order_form_pizza you can see where I am mixing and
> > matching values (with space, with comma, without, etc) trying to get
> > something to work.  None of it does.  $test has a value of 1 when I
> display
> > it.  aline,s1line,sline,toptot are all blank.
> >
> >
> > ------------------------------
> >
> > #!c:\perl\bin\perl.exe
> > # This is pizzahome.pl
> >
> > require 'cgi-lib.pl';
> >
> > $now = localtime;
> >
> > &ReadParse(*input);
> >
> > print "Content-type: text/html\n\n";
> >
> > if ($input{form} eq "form_1") {
> >    &name_address_form;
> > } elsif ($input{form} eq "form_2") {
> >    &order_form_pizza;
> > } elsif ($input{form} eq "form_3") {
> >    &order_form_payment;
> > } elsif ($input{form} eq "form_4") {
> >    &order_form_thanks;
> > } else {
> >    &name_address_form;
> > }
> >
> >
> > sub name_address_form
> > {
> >  print qq~
> >  <html>
> >  <head>
> >    <title>Perfect Pizza Order Form: Name and Address</title>
> >  </head>
> >  <body>
> >    <h2>Perfect Pizza Order Form: Name and Address</h2>
> >    <p>Please enter your name, address and phone number below</p>
> >
> >    <form action="/cgi-bin/pizzaorder.pl" method="post">
> >      <input type="hidden" name="form" value="form_2">
> >      <table border="0">
> >        <tr><td>Name:</td>
> >            <td><input type="text" name="name"></td></tr>
> >        <tr><td>Address:</td>
> >            <td><input type="text" name="address"></td></tr>
> >        <tr><td>Phone:</td>
> >            <td><input type="text" name="phone"></td></tr>
> >        <tr><td></td>
> >            <td><input type="submit" value="Continue">
> >                <input type="reset" value="Clear Form"></td></tr>
> >      </table>
> >    </form>
> >   </body>
> >   </html>~;
> > } # end of entering name and address
> >
> > sub order_form_pizza
> > {
> >   print qq~
> >  <html>
> >   <head>
> >     <title>Perfect Pizza Order Form: Pizza</title>
> >   </head>
> >   <body>
> >   <h2>Perfect Pizza Order Form: Pizza</h2>
> >   <p>Please customize your pizza below.</p>
> >
> >   <form action="/cgi-bin/pizzaorder.pl" method="post">
> >     <input type="hidden" name="form" value="form_3">
> >     <input type="hidden" name="name" value="$input{name}">
> >     <input type="hidden" name="address" value="$input{address}">
> >     <input type="hidden" name="phone" value="$input{phone}">
> >     <table border="0">
> >       <tr><td>What size pizza would you like?<p></td></tr>
> >       <tr><td><input type="radio" name="pizzasize"
value="Small">Small<br>
> >               <input type="radio" name="pizzasize"
> value="Medium">Medium<br>
> >               <input type="radio" name="pizzasize" value="Large"
> > checked>Large<br>
> >               <input type="radio" name="pizzasize"
> > value="X-Large">X-Large<p></td></tr>
> >
> >       <tr><td>Which toppings would you like? (All pizzas include cheese
> and
> > tomato sauce)<p></td></tr>
> >       <tr><td><input type="checkbox" name="toppings" value="X-Cheese,
> > ">Extra Cheese<br>
> >               <input type="checkbox" name="toppings" value="Pepperoni,
> > ">Pepperoni<br>
> >               <input type="checkbox" name="toppings" value="Sausage,
> > ">Sausage<br>
> >               <input type="checkbox" name="toppings"
> value="Onion">Onion<br>
> >               <input type="checkbox" name="toppings"
> > value="Anchovy">Anchovy<br>
> >               <input type="checkbox" name="toppings"
> > value="Mushroom">Mushroom<br>
> >               <input type="checkbox" name="toppings" value="Ham">Ham<br>
> >               <input type="checkbox" name="toppings"
> > value="Pineapple">Pineapple<br>
> >               <input type="checkbox" name="toppings"
> > value="GreenPeppers">Green Peppers<br>
> >               <input type="checkbox" name="toppings"
> > value="JalepenoPeppers">Jalepeno Peppers<p></td></tr>
> >
> >        <tr><td>Additional Comments:</td></tr>
> >        <tr><td><input type="text" name="comments" size="20"
> > maxlength="30"><p></td></tr>
> >        <tr><td><input type="submit" value="Continue">
> >                <input type="reset" value="Clear Form"></td></tr>
> >     </table>
> >   </form>
> >
> >   </body>
> >   </html>~;
> >
> >
> > } # end of entering pizza selection
> >
> > sub order_form_payment
> > {
> >   print qq~
> >  <html>
> >   <head>
> >     <title>Perfect Pizza Order Form: Payment</title>
> >   </head>
> >   <body>
> >   <h2>Perfect Pizza Order Form: Payment</h2>
> >   <p>Please select your payment option below.</p>
> >
> >   <form action="/cgi-bin/pizzaorder.pl" method="post">
> >     <input type="hidden" name="form" value="form_4">
> >     <input type="hidden" name="name" value="$input{name}">
> >     <input type="hidden" name="address" value="$input{address}">
> >     <input type="hidden" name="phone" value="$input{phone}">
> >     <input type="hidden" name="pizzasize" value="$input{pizzasize}">
> >     <input type="hidden" name="toppings" value="$input{toppings}">
> >     <input type="hidden" name="comments" value="$input{comments}">
> >
> >     <table border="0">
> >       <tr><td><input type="radio" name="payment" value="pickup">Pick-Up
> (No
> > Delivery)<p>
> >               <input type="radio" name="payment" value="COD"
> > checked>Cash/Check<p>
> >               <input type="radio" name="payment" value="charge">Charge
> >               <select name="chargetype" size="1">
> >                 <option value="visa">Visa
> >                 <option value="mc">Master Card
> >                 <option value="amex">American Express
> >               </select>
> >           Card Number:<input type="text" name="cardnumber" size="20"
> > maxlength="30"><p></td></tr>
> >        <tr><td><input type="submit" value="Continue">
> >                <input type="reset" value="Clear Form"></td></tr>
> >     </table>
> >   </form>
> >   <input type="hidden" name="payment" value="$input{payment}">
> >   <input type="hidden" name="chargetype" value="$input{chargetype}">
> >   <input type="hidden" name="cardnumber" value="$input{cardnumber}">
> >   </body>
> >   </html>~;
> > } # end of entering pizza payment
> >
> > sub order_form_thanks
> > {
> >   if ($input{pizzasize} eq "Small") {
> >       $pizzacost = 7;
> >   } elsif ($input{pizzasize} eq "Medium") {
> >       $pizzacost = 9;
> >   } elsif ($input{pizzasize} eq "Large") {
> >       $pizzacost = 10;
> >   } else {
> >       $pizzacost = 12;
> >   }
> >
> > @line = @$input{toppings};
> > $test = @line;
> >
> > $totalcost = $pizzacost + $toppingtotal;
> >
> >   print qq~
> > <html>
> >   <head>
> >     <title>Perfect Pizza Order Form: Thanks</title>
> >   </head>
> >   <body>
> >   <h2>Thanks for your order!</h2>
> >
> >   <table>
> >
> >     <tr><td>Your pizza will be delivered piping hot in 30 minutes or
less.
> > If you chose "Pick-Up", your pizza will be ready in about 10
> > minutes.</td></tr>
> >     <tr>
> >   </table>
> >
> >     test = $test<br>
> >     aline = @line<br>
> >     s1line = $line[0]<br>
> >     sline = $line<br>
> >     toptot = $toppingtotal<br>
> >     name=$input{name}<br>
> >     address=$input{address}<br>
> >     phone=$input{phone}<br>
> >     pizzasize=$input{pizzasize}<br>
> >     toppings=$input{toppings}<br>
> >     payment=$input{payment}<br>
> >     chargetype=$input{chargetype}<br>
> >     cardnumber=$input{cardnumber}<br>
> >     total=$totalcost
> >     comments=$input{comments}
> > <p>
> > <a href="/pizzahome.html">Return Home</a>
> >  </body>
> >   </html>
> > ~;
> > }
> >
> >
> >
> >
> >
> >
> >
> >
>
>




------------------------------

Date: Sat, 21 Oct 2000 23:55:58 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: still need help/beginner....pulling my hair !
Message-Id: <x7aebxpx4j.fsf@home.sysarch.com>

>>>>> "n" == none  <none@nospam.com> writes:

  n> All this has to do is COUNT the freakin numer of boxes that were
  n> checked for toppings - all it ever shows is 1.  I've tried
  n> everything, including adding spaces after the topping value in the
  n> form, etc.  Anyway to get this to work, I've only wasted around 4
  n> hours on it.

  n> Thanks. (see bottom part of program for 'toppings' - that's what
  n> I'm trying to count) also in sub order_form_pizza you can see where
  n> I am mixing and matching values (with space, with comma, without,
  n> etc) trying to get something to work.  None of it does.  $test has
  n> a value of 1 when I display it.  aline,s1line,sline,toptot are all
  n> blank.


i'll have a large with pepperoni and mushrooms, please. also an order of
CGI.pm and use strict on the side. mmmm, i smell a homework assignment
in the oven. too bad, i don't do homework. 

  n> #!c:\perl\bin\perl.exe
  n> # This is pizzahome.pl

  n> require 'cgi-lib.pl';

domino's is better than cgi-lib. call right now and they will deliver
working code in 30 minutes or less!

  n> $now = localtime;

not anymore. now is then and the future is now. 

  n> &ReadParse(*input);

  n> sub name_address_form
  n> {
  n>  print qq~

check out the thread on here docs. that quoting style is like cold pizza
and warm beer in the morning.

  n> sub order_form_thanks
  n> {
  n>   if ($input{pizzasize} eq "Small") {
  n>       $pizzacost = 7;
  n>   } elsif ($input{pizzasize} eq "Medium") {
  n>       $pizzacost = 9;
  n>   } elsif ($input{pizzasize} eq "Large") {
  n>       $pizzacost = 10;
  n>   } else {
  n>       $pizzacost = 12;
  n>   }

  n> @line = @$input{toppings};

do you have ANY idea what you are doing there? do you have ANY idea what
cgi-lib might even be stuffing there? switch over to CGI.pm and read its
docs. you might learn how to properly throw a pizza.

  n> $test = @line;

  n> $totalcost = $pizzacost + $toppingtotal;

well, i don't see $toppingtotal anywhere else in this pile of
dough. maybe you knead to set it somewhere.

with coding skills like this, i can assure you future job at pizza hut!
(but not working on their web site).

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


------------------------------

Date: Sat, 21 Oct 2000 23:58:52 GMT
From: Mark <mtaylorlrim@my-deja.com>
Subject: Re: still need help/beginner....pulling my hair !
Message-Id: <8stajr$v37$1@nnrp1.deja.com>

Won't the list of toppings be returned to the variable $input{toppings}
as a sting of values separated by commas?  Just count the commas and
add 1.

Mark


In article <2TnI5.1990$bM2.1631@newsfeed.slurp.net>,
  "none" <none@nospam.com> wrote:
> All this has to do is COUNT the freakin numer of boxes that were
checked for
> toppings - all it ever shows is 1


<snip>



--
Please reply to this newsgroup as my Deja mail
is used as a spam catcher only!


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: Sun, 22 Oct 2000 01:37:26 +0100
From: "Christian Mahnke" <mahnke@fliegen-ist-schoener.de>
Subject: Re: Using text file to display form data
Message-Id: <8st8v7$5d1$02$1@news.t-online.com>

Hello,

try it with

#Open the headings text file
open(INF,"headings.dat")
chomp @ary = <INF>;            <-**************
close(INF);

when you read in the file, could be the newline on the end of evey row,

cheers,

Christian

°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
Fliegen-ist-Schoener.de
http://www.fliegen-ist-schoener.de
mahnke@fliegen-ist-schoener.de
Tel: 0179-5304585
°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
in-House Partner:
http://www.billiger-telefonieren.de/ ~ http://www.stromseite.de/
http://www.billiger-surfen.de/ ~ http://www.tvinfo.de/
http://www.billiger-versichern.de/ ~ http://www.booklooker.de/
http://www.sms.de/ ~ http://www.movil24.com/
°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°

"Matt Perzel" <thectrain@hotmail.com> schrieb im Newsbeitrag
news:venI5.30591$24.6690884@news0.telusplanet.net...
> I am trying to make a program that reads a text file with a list of names
in
> it, then it uses the varibles that have the names from the file to get
data
> posted from the form. I can get the data from the form, read the
text-file,
> split the text file. Everything except use the varible name. Here is my
code
> if you can't understand my blabbering.
>
> NOTE: When I try to use the headings, nothing is displayed. But when I
hard
> code it, it works.
>
> #!/usr/bin/perl
>
> #Get Data From Form *Works
> read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
> @pairs = split(/&/, $buffer);
> foreach $pair (@pairs) {
>     ($name, $value) = split(/=/, $pair);
>     $value =~ tr/+/ /;
>     $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
>     $FORM{$name} = $value;
> }
>
> #Open the headings text file
> open(INF,"headings.dat")
> @ary = <INF>;
> close(INF);
>
> #Write HTML
>
> print "Content-type:text/html\n\n";
> print <<EndHdr;
> <html><head><title>FSA READ/WRITE TEST</title></head>
> <body>
> EndHdr
>
> #This is where I am trying to use the headings from the file to display
the
> form data
> foreach $i (@ary) {
>     print $FORM{'$i'};
> }
> #Here is the problem
>
> print <<EndFooter;
> </body>
> </html>
> EndFooter
>
>
>




------------------------------

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V9 Issue 4687
**************************************


home help back first fref pref prev next nref lref last post