Re: PHP, HTML Forms & PostgreSQL

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: PHP, HTML Forms & PostgreSQL
Дата
Msg-id 20020408194717.A2829@svana.org
обсуждение исходный текст
Ответ на PHP, HTML Forms & PostgreSQL  (Leif Jensen <leif@crysberg.dk>)
Ответы Re: PHP, HTML Forms & PostgreSQL  (Leif Jensen <leif@crysberg.dk>)
Список pgsql-general
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.

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

HTH,
--
Martijn van Oosterhout <kleptog@svana.org>   http://svana.org/kleptog/
> Ignorance continues to thrive when intelligent people choose to do
> nothing.  Speaking out against censorship and ignorance is the imperative
> of all intelligent people.

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

Предыдущее
От: Leif Jensen
Дата:
Сообщение: PHP, HTML Forms & PostgreSQL
Следующее
От: Leif Jensen
Дата:
Сообщение: I18n & Pgaccess ( & psql)