Re: Stings .. Strings .. Strings .. help
| From: | Mohd_Q | Date: | Mon, 16 Sep 2002 17:04:48 +0000 |
| Subject: | Re: Stings .. Strings .. Strings .. help | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-116548@lists.php.net to get a copy of this message | ||
I might have made some mistake in implementing your suggestion, for sure. So
it's not definitely wrong. it is still a considerable solution.
Another big thanks to you ...
----- Original Message -----
From: "John Holmes" <holmes072000@charter.net>
To: "'Mohd_Q'" <ma1420@hotmail.com>; <php-general@lists.php.net>
Sent: Monday, September 16, 2002 7:52 PM
Subject: RE: [PHP] Stings .. Strings .. Strings .. help
> OK. Completely ignore what was suggested.
>
> ---John Holmes...
>
> > -----Original Message-----
> > From: Mohd_Q [mailto:ma1420@hotmail.com]
> > Sent: Monday, September 16, 2002 12:30 PM
> > To: php-general@lists.php.net
> > Subject: Re: [PHP] Stings .. Strings .. Strings .. help
> >
> > I am grateful to you Holmes, you're the only one tried to help.
> >
> > Thanks God, It has been solved finally.
> > Here's what I have done
> >
> > while ($i <= $datacount){
> > var[$i] = $_POST[(var.$i)];
> > $i++;
> > }
> >
> > that simple.
> > I was insisting on going one way. I tought I have to use braces "{}"
> but
> > but I did it using brackets
> >
> > (var.$i) is equal to var2, var3, var4, etc in the form .
> >
> > THANKS
> >
> >
> > ----- Original Message -----
> > From: "John Holmes" <holmes072000@charter.net>
> > To: "'Mohd_Q'" <ma1420@hotmail.com>;
> > <php-general@lists.php.net>
> > Sent: Monday, September 16, 2002 7:21 PM
> > Subject: RE: [PHP] Stings .. Strings .. Strings .. help
> >
> >
> > > Show your code (partial), it works.
> > >
> > > ---John Holmes...
> > >
> > > > -----Original Message-----
> > > > From: Mohd_Q [mailto:ma1420@hotmail.com]
> > > > Sent: Monday, September 16, 2002 11:49 AM
> > > > To: php-general@lists.php.net
> > > > Subject: Re: [PHP] Stings .. Strings .. Strings .. help
> > > >
> > > > I forget to say that the values in the form are in drop-down not
> text
> > > > boxes.
> > > >
> > > > ----- Original Message -----
> > > > From: "Mohd_Q" <ma1420@hotmail.com>
> > > > To: <php-general@lists.php.net>
> > > > Sent: Monday, September 16, 2002 6:46 PM
> > > > Subject: Re: [PHP] Stings .. Strings .. Strings .. help
> > > >
> > > >
> > > > > Unfortunately, no .. it doesn't work.
> > > > >
> > > > > I think if I do it using {}, it might work.
> > > > >
> > > > > Thanks J. Holmes.
> > > > >
> > > > > ----- Original Message -----
> > > > > From: "1LT John W. Holmes" <holmes072000@charter.net>
> > > > > To: "Mohd_Q" <ma1420@hotmail.com>;
> > > > > <php-general@lists.php.net>
> > > > > Sent: Monday, September 16, 2002 6:38 PM
> > > > > Subject: Re: [PHP] Stings .. Strings .. Strings .. help
> > > > >
> > > > >
> > > > > > Say you have 3 text boxes, like this:
> > > > > >
> > > > > > <input type='text' name='var[]'
> > > > > > value='one'>
> > > > > > <input type='text' name='var[]'
> > > > > > value='two'>
> > > > > > <input type='text' name='var[]'
> > > > > > value='three'>
> > > > > >
> > > > > > Then, on your processing page, you'll have a variable
> > > $_POST['var']
> > > > > that'll
> > > > > > be an array that'll contain the contents of each text box.
> > > > > >
> > > > > > $_POST['var'][0] => one
> > > > > > $_POST['var'][1] => two
> > > > > > $_POST['var'][2] => three
> > > > > >
> > > > > > Does that help?
> > > > > >
> > > > > > ---John Holmes...
> > > > > >
> > > > > > ----- Original Message -----
> > > > > > From: "Mohd_Q" <ma1420@hotmail.com>
> > > > > > To: <php-general@lists.php.net>
> > > > > > Sent: Monday, September 16, 2002 11:30 AM
> > > > > > Subject: Re: [PHP] Stings .. Strings .. Strings .. help
> > > > > >
> > > > > >
> > > > > > > Thanx J. Holmes ...
> > > > > > >
> > > > > > > Good suggestion ..
> > > > > > >
> > > > > > > I did try that but how to get results .. I failed too.
> > > > > > >
> > > > > > > Mohd Q.
> > > > > > > ----- Original Message -----
> > > > > > > From: "1LT John W. Holmes"
> > > > > > > <holmes072000@charter.net>
> > > > > > > To: "Mohd_Q" <ma1420@hotmail.com>;
> <php-general@lists.php.net>
> > > > > > > Sent: Monday, September 16, 2002 6:31 PM
> > > > > > > Subject: Re: [PHP] Stings .. Strings .. Strings .. help
> > > > > > >
> > > > > > >
> > > > > > > > Name your form elements as var[ ], instead of var1, var2,
> etc,
> > > and
> > > > > > you'll
> > > > > > > > already have an array with $_POST['var'] that
> > > > > > > > holds the
> > > values.
> > > > > > > >
> > > > > > > > ---John Holmes...
> > > > > > > >
> > > > > > > > ----- Original Message -----
> > > > > > > > From: "Mohd_Q" <ma1420@hotmail.com>
> > > > > > > > To: <php-general@lists.php.net>
> > > > > > > > Sent: Monday, September 16, 2002 11:21 AM
> > > > > > > > Subject: [PHP] Stings .. Strings .. Strings .. help
> > > > > > > >
> > > > > > > >
> > > > > > > > Help .. please ..
> > > > > > > >
> > > > > > > > There is a form where I have variables
> > > > > > > >
> > > > > > > > var1 , var2 , var3, var4 ...
> > > > > > > >
> > > > > > > > ok ..
> > > > > > > >
> > > > > > > > when these variables are submitted, I tried to assign
> them to
> > > an
> > > > > array
> > > > > > > > BUT I FAILED .
> > > > > > > >
> > > > > > > > I tried something like :
> > > > > > > >
> > > > > > > > while ($i <= $varCount){
> > > > > > > > $tchr[$i] = $_POST["({var$i})"];
> > > > > > > > $i++;
> > > > > > > > }
> > > > > > > >
> > > > > > > > but no good ..
> > > > > > > >
> > > > > > > > any help ..
> > > > > > > >
> > > > > > > > Thanx
> > > > > > > >
> > > > > > > > MQ.
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > 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
> > > > >
> > > >
> > > > --
> > > > 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
>