Author Topic: input=submit query  (Read 2672 times)

grognut

  • Hero Member
  • *****
  • Posts: 55
    • View Profile
input=submit query
« on: August 31, 2007, 04:14:34 PM »
Hi all,

I have the following html code
Code: [Select]
<FORM METHOD=GET action=RTC.CGI>
<table>
<tr><td>Temp_1:</td>
<td><input type=text size=2 maxlength=4 name=f value=%wA1><input type=submit name=P value=Set></td></tr>
</table>
</form>
This produces and entry box and a submit button the screen.
My confusion is that when the button is pressed if need to catch 'f' in HTTPExecGetCmd to read the value from the entry box and not 'P'.

Can someone enlighten me as to the best practice for doing this.

Best regards
Grognut.

niroblock

  • Hero Member
  • *****
  • Posts: 140
    • View Profile
Re: input=submit query
« Reply #1 on: September 02, 2007, 03:26:50 AM »
hi Grognut,

the control “submit” sends the form concerning the method of same, reading the present values of the fields of data that compose it.

example:

 <form method=get action=mypage.cgi>
   <input type=text name=mycode value= "1234" >
   <input type=text name=myname value= "niroblock" >
   <input type=submit name=mysubmit value= "Send" >
 </form>

when the button “Send” is pressed, is sent this information mypage.cgi?mycode=1234&myname=niroblock
and nothing else.

byee.
do not make any questions, if you already have the answer!

grognut

  • Hero Member
  • *****
  • Posts: 55
    • View Profile
Re: input=submit query
« Reply #2 on: September 03, 2007, 04:47:48 AM »
Thanks niroblock,

I now understand it better. eg for "mycode=1234" mycode is the command in the name array and 1234 is in the value array. Correct me if I'm wrong.

I tried your suggested html code
Code: [Select]
<form method=get action=mypage.cgi>
   <input type=text name=mycode value= "1234" >
   <input type=text name=myname value= "niroblock" >
   <input type=submit name=mysubmit value= "Send" >
 </form>

pressed "Send"  and got a slightly different result

html/mypage.cgi?mycode=1234&myname=niroblock&mysubmit=Send.

This is the from error reported from Firefox.

ie the submit button value is sent as well.

The real question is How does execNameValueCmd(...)  handle it.

Is it called for each command/value pair, in which case "mysubmit=Send" should also be handled or is it called only once in which case only "mycode=1234" will be handled.

Sorry to ask what may appear to simplequestions but I'm not getting the results I expect so I don't fully understand the operation of the modtronix board.

I'm using 3.04 firmware at the moment, I don't know if this makes a difference.

Thanks in advance to you and any one else who may respond.

grognut

niroblock

  • Hero Member
  • *****
  • Posts: 140
    • View Profile
Re: input=submit query
« Reply #3 on: September 04, 2007, 02:11:10 AM »
hi grognut,

acquittal the name to “submit”! simple no?

by comfort them commando by HTTP is sent in form of initials, example “mycode” you change it with “mc”, “myname” with “mn” (to simplify)

because the board analyzes caracters separately and not as a whole:

under an only Array that is called “param” (parameters)

the separator between the name of the parameter and the value of the parameter is “=” and the separator between parameters is “&”

this you can find it in the type function:
 HTTPGetParam BYTE (TCP_SOCKET s, BYTE* param, BYTE* paramLen). in the file http.c

and to modify “excNameValueCmd” read this post:


Send number from HTTP Client


in post also I explain the differences between 3.04 and 3.06

_   
you do not worry the questions but simple, they can be but the complicated ones to answer! :wink:

byee.
do not make any questions, if you already have the answer!