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 10:52:48
Message-ID: Pine.LNX.4.21.0204081247180.24261-100000@samba.crysberg.dk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Hi Martijn,

Thx for your quick reply.

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

> On Mon, Apr 08, 2002 at 11:26:47AM +0200, Leif Jensen wrote:
> >
> > Hi all,
> >
> > I'm doing some intranet pages using PHP & PostgreSQL. (Our corporate
> > database is 'of course' using PostgreSQL ;-). I like this interface and
> > have had great help in looking at PgAdmin, which I have been using from
> > time to time.
> >
> > I have some problems with HTML forms and how they interface to PHP, and
> > I haven't been able to locate any description of this (neither in the HTML
> > manuals or in the PHP manuals). From testing and looking at PgAdmin, I
> > figured out how to name variables and assign values.
>
> Lookup the HTML specs, I think they say something about this. It is defined
> somewhere.

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.

>
> > However, my specific problem is using checkboxes:
> >
> > 1) If a checkbox is unchecked, I'm not getting any values,
> >
> > 2) If a checkbox is checked, I'm getting the value 'on' where I need 't'
> > in the update sql statement.
> >
> > Is there any way to make sure the variable (checkbox) will appear in the
> > php action when the value changes (or every time)? Is there a way to make
> > the form 'return' 't' in stead of 'on'?
>
> Nope, HTML just works that way. It works like that on every browser i've
> seen. Remember, those values come from the browser, not anything you can
> control.
>
> Note that the value= part of the checkbox controls the value returned when
> ticked.
>
> Something like:
>
> if( $box != "t" )
> $box = "f"
>
> all done.

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. !?

Greetings,

Leif

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message tony 2002-04-08 10:53:22 Re: I18n & Pgaccess ( & psql)
Previous Message Leif Jensen 2002-04-08 09:49:09 I18n & Pgaccess ( & psql)