Server Response.
Posted: Thu Jul 14, 2011 8:37 pm
What I am trying to do : A user enters username and password into fields. The app collects this data and sends it to the server. I am using some examples I have found and everything seems to work great. I cannot seem to find however...in the dictionary or tutorials, a way to create an if statement for a server response. The server will respond with a simple 1 or 0. The server is currently being set up so I cannot test with a live URL. Here is what I have thus far.
Would it be something as simple as?
Thx for any help guys!
Code: Select all
on mouseUp
put fld "username" into tUNA
put fld "password" into tPWA
put "http://" & tUNA & ":" & tPWA & "\" & "@www.example.net/index.html" into compiled
saveUNandPW
end mouseUp
command saveUNandPW
put specialfolderpath("documents") & "/text.txt" into tFile
put compiled into url("file:" & tFile)
go to card 3
end saveUNandPW
Code: Select all
on mouseUp
put fld "username" into tUNA
put fld "password" into tPWA
put "http://" & tUNA & ":" & tPWA & "\" & "@www.example.net/index.html" into compiled
## post command inserted here with proper URL and above example.net changed
##in theory after post completes
if response from server is 1 then
continue
else
##report error here
saveUNandPW
end mouseUp
command saveUNandPW
put specialfolderpath("documents") & "/text.txt" into tFile
put compiled into url("file:" & tFile)
go to card 3
end saveUNandPW