Post by jlbachiochi on Sept 16, 2013 12:25:38 GMT -5
The problem is I want this to be automatic, no submit button, let me explain further with a little code...
'-------------- text -------------------
html "<input type='hidden' name='text' id='id' value='";text$;"' size=40/>"
html "<br>"
text$=#request get$("text")
[File]
open "/public\Poll.txt" for append as #writeIt
print #writeIt, UserAddress$;",(text$=";text$;")"
close #writeIt
'print UserAddress$;",(text$=";text$;")"
end
Assuming a 'post' comes to this url, I want to log the variable text$ to a file.
To simulate a post coming in I am using this code...
url$="192.168.1.69:8008"
[loop]
button #acd, "Post text$", [doIt]
button #ex, "Exit", [doExit]
wait
[doIt]
cls
x=x+1
name$=chr$(34)+"text"+chr$(34)
value$=chr$(34)+"Test "+str$(x)+chr$(34)
packet$=chr$(123)+name$+":"+value$+chr$(125)
#acd setkey(text$)
print text$
on error goto [httpGetError]
message$=httppost$(url,ドル packet$)
[results]
print "httppost$ to:";url$
print "packet:";packet$
print "return:";message$
goto [loop]
[doExit]
end
The url used here goes to the RB server which is serving the first program. I assume the post is in the JSON format. I hope this is clear.
--jeff