Re: PHP, HTML Forms & PostgreSQL

From: Leif Jensen <leif(at)crysberg(dot)dk>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: PHP, HTML Forms & PostgreSQL
Date: 2002-04-08 11:20:50
Message-ID: Pine.LNX.4.21.0204081313390.24549-100000@samba.crysberg.dk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message tony 2002-04-08 11:28:46 Re: I18n & Pgaccess ( & psql)
Previous Message Leif Jensen 2002-04-08 11:10:52 Re: I18n & Pgaccess ( & psql)