Submitting info from my form to another websites database

Using Coldfusion 9.

I'd like to create an application that will allow my users to setup a profile with their usernames and passwords to other sites and allow them to submit, edit and delete information to all of them from one account (my site).

For an example:  Say my users have accounts with both and to list their business information.  They could create an account on my site, setup their usernames and passwords with both of these other sites and then submit, edit and delete their business listings from one spot.  Is this type of thing possible?

Seems like I should be able to copy the field names on their submit form and make sure the data is formatted correctly and submit to the action page of that form and it would work the same as if I was entering the data directly in their own form?  I'm sure it's not that easy but seems doable.  Thoughts?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


Not entirely as easy as you say, but could be doable (not guaranteed).

I have done it using C before by creating and maintain a connection/session to the site.  I needed to use a sniffer to figure out all the different values passed with each request.   Not sure how well this can be done in Coldfusion.

You have to login to these other sites, therefore you must maintain a session.  Single calls to the other site may not keep the session open.   You have to see about maintaining cookies that the browser may set when used.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MFredinAuthor Commented:
Thanks for the reply, gdemaria.  

So would I need to maintain a session to the other sites for each separate user?  You're saying I would need each user constantly logged into the other site?  I'd need a way to figure out when a session will expire and the ability to re-connect each session before it expires?  Am I on the right track?

I've got most of the values needed figured out.  What would be my next step?
I think experimentation is the answer.  Try submitting a username and password to the login action and then submitting to another page such as save address.
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

MFredinAuthor Commented:
Cool.  So I've setup a username and password form on my side that submits to the login action page of the other site.  If the login is successful, the page redirects to default.asp?success=1  if it wasn't correct username or password the url variable is ?success=2.  

Is there any way I can check to see if the username & password is correct using this URL variable "behind the scenes" somehow?  What I mean is, I will display the username and password form on my site.  The user will enter their U&P to the other site and the page will check to see if the U&P was accepted on the other site and show the results to the user without having to actually leave the page.... or at least my site.  So the system would post and check the url variable without having to leave the current page. Would this be possible?  

Code Example Below Was Yanked Straight from the CF Documentation - Credit where credit is due!

I have done this several times in automatically submitting files to different reporting agencies...

Utilizing CFHTTP with the POST method will get you where you want to go.  All you need is an indicator to search for within the target page (returned by cfhttp.filecontent variable).  Maybe for instance you would search for the words "Welcome John Smith" for a successful submission, or "error", 'Invalid' or some other indicator for a failed request.

<cfhttpparam type="Formfield"
<cfhttp method="Post"
    <cfhttpparam type="Cookie"
    <cfhttpparam type="CGI"
        value="cgivar "
    <cfhttpparam type="URL"
    <cfhttpparam type="Formfield"
    <cfhttpparam type="File"
File Content:<br>
Mime Type:#cfhttp.MimeType#<br>

Open in new window

Oh - and a strong reminder on that response...

It assumes that there is NOT validation on the other end as to where the request came from.
i.e. ( < cfif #mydomainname# NOT IN cgi.httpreferer > GO AWAY < cfelse> GO AHEAD < /cfif>
I use forms of that more and more in my coding to avoid certain formbots...
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ColdFusion Language

From novice to tech pro — start learning today.