Re: PHP, HTML Forms & PostgreSQL

Поиск
Список
Период
Сортировка
От Leif Jensen
Тема Re: PHP, HTML Forms & PostgreSQL
Дата
Msg-id Pine.LNX.4.21.0204081313390.24549-100000@samba.crysberg.dk
обсуждение исходный текст
Ответ на Re: PHP, HTML Forms & PostgreSQL  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-general
   Hi again,


On Mon, 8 Apr 2002, Martijn van Oosterhout wrote:

> On Mon, Apr 08, 2002 at 12:52:48PM +0200, Leif Jensen wrote:
> >    I have looked in the HTML 4.0 recommendation, which talks about how
> > form data is being handled, but it doesn't say anything about how PHP
> > treats the result.
>
> Hmm, I'm not sure then, but this is the way I've always known it to work.
>
> >    That's a possibility if you on forehand know the name(s) of checkboxes
> > in your form. I was trying to make a general sql construction of an update
> > statement independent of what might be in the form. !?
>
> Well, I don't know if you can get the variables in a hash, like in perl.

   I have noticed that all the 'successful controls' are listed in the
_GET array or the _POST array ! But their type is unknown. From here I can
scan and generate my sql update statement!

> Another thing that sometimes works is:
>
> <input type=hidden   name=box value=f>
> <input type=checkbox name=box value=t>
>
> When the tickbox is ticked, the browser will return two values named "box",
> which *may* cancel out to give you your t/f combo.
>
> Note this is extremely system specific and not guarenteed and not
> recommended. But I have used it successfully on occasion.
>

   This might be worth a try, but as you say non-standard. In the tests I
have done, PHP (or maybe it's rather the user agent!?) puts the controls
in corresponding variables in the order they are listed in the form. And
what happens to the value when the user toggles the checkbox ?

   Thanks,

 Leif


В списке pgsql-general по дате отправления:

Предыдущее
От: Leif Jensen
Дата:
Сообщение: Re: I18n & Pgaccess ( & psql)
Следующее
От: tony
Дата:
Сообщение: Re: I18n & Pgaccess ( & psql)