Re: PHP, HTML Forms & PostgreSQL
От | Nigel J. Andrews |
---|---|
Тема | Re: PHP, HTML Forms & PostgreSQL |
Дата | |
Msg-id | Pine.LNX.4.21.0204082052570.2690-100000@ponder.fairway2k.co.uk обсуждение исходный текст |
Ответ на | Re: PHP, HTML Forms & PostgreSQL ("S Dawalt" <shane.dawalt@wright.edu>) |
Список | pgsql-general |
On Mon, 8 Apr 2002, S Dawalt wrote: > > Insofar as return values, you can use the "value=" clause of the checkbox > to return whatever value you want when it has been "checked". If you want > the checkbox to return something when it hasn't been checked, then prior to > defining the checkbox, define a hidden type of the same name as your > checkbox, but place the "unchecked" value in it. If the checkbox isn't > checked then your default value gets returned by the browser, otherwise the > value specified within the checkbox definition is returned. I think I > found this on the PHP website several months ago. It works quite well. Ok, but once again this is surely relying on browsers 'playing ball'. What happens if I use a browser that returns the hidden parameter with it's value whether or not the checkbox is checked, as it should? I'm guessing that since you mention the order in the form this is actually relying on the browser returning parameters in the order they occur within the form and the server providing only the latest definition to the application, the PHP action page. So what happens if I use a browser which returns parameters in some other order as one is perfectly entitled to do? What happens if the web server implements a 'first come first served' parameter setting scheme? Any, back to the original desire and to keep some what on topic, how about using a function installed in the DB server to perform the data validation? Or is the problem that PHP can't provide a null parameter to a function if there isn't a variable, from the form parameter, defined at the time of the call? Another or: isn't this also not helping towards the general form handling idea that is the real aim? -- Nigel J. Andrews Director --- Logictree Systems Limited Computer Consultants
В списке pgsql-general по дате отправления: