html forms and BlitzMax

BlitzMax Forums/BlitzMax Programming/html forms and BlitzMax

allos(Posted 2007) [#1]
I need to establish communication to and from an html form, to fill and get data for a database (I'm using sqlite at the moment)
the html form has a number of input fields and the usual "submit" button; how can I get data from input fields (e.g. one or more strings) transformed into variables?
the inverse is not a problem (I can easily pass blitz variables to html and display it in an htmlview)
once understood, the whole stuff should work locally and on the web...
yes, I know, php/mysql would easily solve my problem, but it would be nice not to change my favourite programming language...
thank you - allos


Dreamora(Posted 2007) [#2]
Stuff from forms is appended to the url in a similar way as you would add stuff to php to make it work. So if you have an input box called someThing, you will have ?someThing=xxxx in the url the HTML is calling (I'm just not sure anymore if this was in POST or in GET so you would have to try that one out)

But dumb question: why do you want to use html forms instead of MaxGUI gadgets which would work better for that job? (you could still show the result of the database gathering as HTML)


allos(Posted 2007) [#3]
thank you Dreamora, I will try your way; but tell me please exacly what "appended to the url" means (in case my html form is resident on my hard disk?)
The main problem with input forms with MaxGui gadgets (which I am using) is when you need to print a form; printing is easy from htmlview gadgets, much more difficult, as long as I can see, from other gadgets


Dreamora(Posted 2007) [#4]
appended means for example

file://c:/htmlform.html?inputBox1="sweet"

But it isn't that easy to parse that out.

That is why I suggested using normal MaxGUI gadgets and for sending, saving or printing (you are right, its the only usefull way), you could convert those input to a html where you simply fill the "spaces" which are meant for those data with the maxgui informations.

Should be straight forward as most of the html is "hardcoded", only few information need to be added at generation. It isn't hard actually to create code that does that beside the fact that you need to save the whole html file to harddisk to open for the html gadget. but I don't think this should be a problem :)


allos(Posted 2007) [#5]
ok, I agree with you and have reached the same conclusions; this is the simplest way after all