How to communicate with a remote application that uses http post to request connection
Ok, I will try to make this simple as to avoid any
confusion.
I am trying to receive connection requests from remote applications installed on user pc's.
The application uses POST method to send the request to connect to my database, and if required update some tables.
The application is not a webpage. I have no access to the internal workings of the application nor do I have any specific information about how it sends its POST. I am sure of the following:
The app will POST to my .cfm page
"IsConnectionAllowed" = "yes"
This is asking my cfm page if its ok to connect. I would need to use a <cfif> to verify the the first part of the POST is in fact
"IsConnectionAllowed" = "yes"
If this returns true, (the app also uses to POST to pass "username" and "password") my .cfm page will then perform a query and check the username and password against the database. If a matching record is found, the application expects my page to reply with
"#Answer# OK- connected;"
Once the answer is given the application will then respond with data to insert or update my tables.
Now, I know how to do the queries and update tables etc, but I have never received data from an application before.
I tried using the <cfform> tag with a mehod of GET, and then trying to send my reply with <cfoutput>, but that didn't work. The application doesn't give any feedback or error messages. It either connects or not.
I also tried the <cfhttp> tag, but that didnt work either. I am not very experinced with coldfusion. I used it years ago and am just getting back into it.
I am sure this is a pretty easy thing to do, but my methods arent working.
Using the above information, can somone please show me how I would accomplish this communication? I can then use the same method to retrieve the data for my table updates and queries.
Here is a sample of what I have already tried:
<cfform method="get">
<cfif>
"IsConnectionAllowed" = "yes"
<!-- I need to query a username or password. But for testing I will just give the OK to connect -->
<cfoutput>#Answer# Ok - connected;</cfoutput>
<cfelse>
<!-- When I query username and password, if the query returns no records I deny the connection -->
<cfoutput>#Answer# Not connected;</cfoutput>
</cfif>
</cfform>
BTW, I have examples of this being done using .php and .asp. I need to do this using .cfm. I can post the either the .php or.asp code if it will be helpful in converting the function into a .cfm page.
