I already have that. $_POST['vars'] is a number and I already check that you
on a page before. All I need to know is how to keep adding numbers until
there are no more to add...


----- Original Message -----
From: "Ray Hunter" <[EMAIL PROTECTED]>
To: "Stephen" <[EMAIL PROTECTED]>
Cc: "PHP List" <[EMAIL PROTECTED]>
Sent: Wednesday, December 04, 2002 4:33 PM
Subject: Re: [PHP] Looping Addition


> What type is $_POST['vars']?  I think that it is a string...you might
> have to convert it to an integer...
>
> if( is_numeric( $_POST['vars'] ) )
> {
> $vars = (int)$_POST['vars'];
> }
> else
> {
> echo "Error: \$_POST['vars'] is not an integer.";
> }
>
> On Wed, 2002-12-04 at 14:26, Stephen wrote:
> > Sorry for the uncontrolable emaling to the list but I'm in rather a
stump.
> > You may be hearing a lot from me over the next few days too.
> >
> > Anyway, I mentioned before my form with the addition that loops to the
> > number of numbers the user wants to add. Now to the part of the actual
> > addition, how could I loop that out also?
> >
> > Here's what I'm trying to do right now but naturally, it doesn't work:
> >
> >  $output = 0;
> >  $current = 1;
> >  do
> >  {
> >   $output .= $num.$current +
> >   $current++;
> >  } while($current <=  $_POST['vars']);
> >
> > Any help would be great! Thanks!
> >
> > Thanks,
> > Stephen Craton
> > http://www.melchior.us
> >
> > "What is a dreamer that cannot persevere?" -- http://www.melchior.us
> >
> >
> > ______________________________________________________________________
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to