Re: Re: help w/hidden fields and storing an int.
| From: | Patrick Roane | Date: | Tue, 18 Jan 2005 02:59:45 +0000 |
| Subject: | Re: Re: help w/hidden fields and storing an int. | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-25364@lists.php.net to get a copy of this message | ||
Thanks-
I will look into session vars.
--- Jason Barnett <jason.barnett@telesuite.com> wrote:
> Patrick Roane wrote:
> > I am tring to store and display the number of
> requests
> > that a user has submitted via a hidden field. I've
> > created a form that does a some simple addtion.
> > Everything works, but I need some direction as to
> how
> > I can store each number the user puts in and to
> > display them.
> > Please see below:
> >
> > <?php
> > if ( ! isset( $_POST['number1'] ['number2'] ) ) {
> > $message = "Welcome to the numbers game!";
> >
> > }
> > $number1 = (int) $_POST['number1'];
> > $number2 = (int) $_POST['number2'];
> > $result = (int) $number1 + $number2;
> >
> > $num_selections = (int) $POST['num_selections'];
> > $num_selections++; // this is my attempt at
> collecting
>
> This will only store the num_selections for *this
> request*. Each time
> you submit a form, it is a new request. To store
> information over
> requests most people would use session variables:
>
> http://www.php.net/manual/en/ref.session.php
>
>
> --
> Teach a person to fish...
>
> Ask smart questions:
> http://www.catb.org/~esr/faqs/smart-questions.html
> PHP Manual: http://www.php.net/manual/en/index.php
> php-general archives:
> http://marc.theaimsgroup.com/?l=php-general&w=2
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
=====
----------------
"forget your lust for the rich man's gold. All that you need, is in your soul. You can do
this if you try. All that I want for you my son, is to be satisfied"
~ Lynard Skynard