PHP, HTML Forms & PostgreSQL 
Author Message
 PHP, HTML Forms & PostgreSQL

Quote:



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

  True, PHP is a completely different beast from HTML. The HTML spec will
not talk about it. Go to www.php.net and look at the manual. There's lots
of good info there.

  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.

  Shane

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://www.***.com/



Sat, 25 Sep 2004 03:39:39 GMT
 PHP, HTML Forms & PostgreSQL

Quote:

>   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

---------------------------(end of broadcast)---------------------------



Sat, 25 Sep 2004 04:07:20 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. php + odbc + html forms

2. need PHP script to make HTML form from a MySql table

3. [PHP] RPMs for PHP accessing PostgreSQL via ODBC over RedHat

4. [PHP] PostgreSQL + PHP + SQL warning messages

5. PHP+MySQL vs. PHP+PostgreSQL

6. PHP & PostgreSQL

7. PHP & PostgreSQL Search Result Recordsets

8. php & postgresql data type

9. Forms 4.5 & HTML

10. HTML Forms & ICE

11. paradox->html?? html form->paradox

12. Oracle && PHP


 
Powered by phpBB® Forum Software