Re: Designing an input form for one-to-many etc.
| From: | Derek Paterson | Date: | Mon, 09 Oct 2000 09:55:10 +0000 |
| Subject: | Re: Designing an input form for one-to-many etc. | ||
| References: | 1 2 3 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-3425@lists.php.net to get a copy of this message | ||
OK I think I'm going nuts.
I've had pages that have worked fine for many months using html "<select
multiple". I had a look in order to answer the question - the php page uses
HTTP_POST_VARS as an array and if any of the input fields were select
multiples the array had multiple entries with the same variable name.
They now don't work. They only pass the last value in the list.
They were originally written in php3.0.16 but I now use php4.0.2 - has
something changed?
Derek
----- Original Message -----
From: "Koos van den Hout" <koos@kzdoos.xs4all.nl>
To: <php-db@lists.php.net>
Sent: Sunday, October 08, 2000 12:53 PM
Subject: Re: [PHP-DB] Designing an input form for one-to-many etc.
> Quoting Mike Erickson who wrote on Sat, Oct 07, 2000 at 02:26:10PM -0700:
>
> > I have a similar problem. I am writing an online contact database and
> > people may have an arbitrary number of phone numbers, email addresses,
> > etc. and I haven't figured out a good way to have them input the
> > information, other than just having them re-use the form and append
> > data; but I hate that approach. I'd like to see your code.
>
> For 'just' one-to-many problems, there is the following approach:
>
> Give multiple input-fields with variable phonenumber[] (including the []).
>
> On processing the form you'll have the array phonenumber that you can walk
> through with each().
>
> The easiest way for an update-form is to give a number of extra
> phonenumber[] fields, and on processing the update delete all the
> associated phonenumbers connected to the record and insert them from the
> form.
>
> Koos
>
> --
> Koos van den Hout, PGP keyid RSA/1024 0xCA845CB5 via keyservers
> koos@kzdoos.xs4all.nl or DSS/1024
-?)
> Fax +31-30-2817051 Visit my site about books with reviews
/\\
> http://idefix.net/~koos/
> http://www.virtualbookcase.com/
_\_V
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net