I have a desktop application is going to use an online registration scheme to validate that the user is a licensed user of my software. A friend of mine has written the CGI scripts and created the online database for all this. He's not a RunRev guy, but has told me what he needs to get from the stack. I now need to figure out how to connect from my desktop stack to the server and get back the responses to the validation request.
This is what he needs from me:
I send him a URL like this:
myDomainName.com/bin/validate.php?key=####
I get back a response that I use to determine whether to allow the user to continue.
I have no idea how to send this kind of query from LiveCode or how to receive a response. I'm from HyperCard days when there was no Internet and don't really know how to communicate with servers this way. How do I communicate? What is the command sequence to do this?
Communicating with CGI script
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Communicating with CGI script
Hi Pebah
There are two types of parameter passing requests to a url, GET and POST. The method you need looks to be GET from the url you give above. Under normal circumstances I would suggest that is not a great way to handle authentication requests because the key would normally be displayed in the browser's address bar and plainly visible along the way.
For a GET request you can simplyyou can then examine the authentication response to see what it contains.
If you end up using the POST method you can do similarly by constructing the key and value pair to postagain you can check the authentication response to determine how to proceed. The response received is entirely dependent on what goes on in your friend's script and how it structures the output.
Hope that helps
There are two types of parameter passing requests to a url, GET and POST. The method you need looks to be GET from the url you give above. Under normal circumstances I would suggest that is not a great way to handle authentication requests because the key would normally be displayed in the browser's address bar and plainly visible along the way.
For a GET request you can simply
Code: Select all
put urlencode(theKey) into tKey
get url ("http://myDomainName.com/bin/validate.php?key=" & tKey)
put it into tAuthenticationResponse
If you end up using the POST method you can do similarly by constructing the key and value pair to post
Code: Select all
put libUrlFormData ("key",theKey) into tKey
post tKey to url ("http://myDomainName.com/bin/validate.php")
put it into tAuthenticationResponse
Hope that helps