Re: PHP, HTML Forms & PostgreSQL

Поиск
Список
Период
Сортировка
От Nigel J. Andrews
Тема Re: PHP, HTML Forms & PostgreSQL
Дата
Msg-id Pine.LNX.4.21.0204081638180.2690-100000@ponder.fairway2k.co.uk
обсуждение исходный текст
Ответ на Re: PHP, HTML Forms & PostgreSQL  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-general
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.

I've never used PHP but surely the HTML specs. not having anything to say about
PHP should not be a surprise? Isn't PHP a scripting language whose only
connection with HTML is that it is embedded within HTML?

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

As Martijn says, this is all browser dependent stuff. The whole web thing works
with servers not assuming anything about the client and you don't really want
to start doing so.

As for the general form handling issue how about having a table(s) holding
definitions of forms which the form display page and the form target page can
retrieve and do stuff with? Although generally aren't you going to want
specialisations for most form handlers to implement their own validy checks
etc. which will require knowledge in the PHP code somewhere about the form's
details? Although for that I suppose it could be done client side in javascript
held in the form definition table(s) but then you're back to the form handler
making assumptions about the client.


--
Nigel J. Andrews
Director

---
Logictree Systems Limited
Computer Consultants


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Tcl_CreateSlave error (pg 7.1.2, RH 7.2)
Следующее
От: "Gregory Wood"
Дата:
Сообщение: Re: Porting from MySql - meta data issues