alez
10-19-2005, 01:17 PM
Hi,
Well, Ive been trying to tackle this problem for a long time and its getting frustrating. Im sure its something stupid, but cant work it out. Im trying to send variables from flash to a coldfusion document in order to save all the data in an Access database. Please, would be really nice if you can give some tips to a desperate :eek: CFM newbie
This is the code in Flash 8 :
var varsProfesional:LoadVars = new LoadVars();
var varsProfesional_respuesta:LoadVars = new LoadVars();
varsProfesional.onLoad = function(exito)
{
if (exito)
{
msg = "Variables enviadas " + this.respuestaCF;
}
else
{
//Mostrar mensaje de error en el campo de texto
msg = "Error!! :(";
}
};
function enviarVariablesProfesional() {
varsProfesional.usuario = usuario;
varsProfesional.nombre = nombre;
varsProfesional.cif = cif;
varsProfesional.clave = clave;
varsProfesional.telefono1 = telefono1;
varsProfesional.telefono2 = telefono2;
varsProfesional.email = email;
varsProfesional.web = web;
varsProfesional.sendAndLoad("cf/nuevaEmpresa.cfm", varsProfesional_respuesta, "POST");
}
And this is the code in the coldfusion document:
<cfsetting enablecfoutputonly="Yes">
<cfquery name="chekcUsr" datasource="sdes">
SELECT *
FROM tbEmpresas
WHERE cif = '#FORM.cif#'
</cfquery>
<cfif checkUsr.RecordCount NEQ 0>
<cfoutput>
&respuestaCF=notOK&
</cfoutput>
<cfelse>
<cfquery name="empresasQRY" datasource="sdes">
INSERT INTO tbEmpresas(usuario, nombre, cif, clave, telefono1, telefono2, email, web)
VALUES ( '#FORM.usuario#' , '#FORM.nombre#' , '#FORM.cif#' , '#FORM.clave#' , '#FORM.telefono1#' , '#FORM.telefono2#' , '#FORM.email#' , '#FORM.web#')
</cfquery>
<cfoutput>
&respuestaCF=OK&
</cfoutput>
</cfif>
Thank you all in advance for this great site!
Well, Ive been trying to tackle this problem for a long time and its getting frustrating. Im sure its something stupid, but cant work it out. Im trying to send variables from flash to a coldfusion document in order to save all the data in an Access database. Please, would be really nice if you can give some tips to a desperate :eek: CFM newbie
This is the code in Flash 8 :
var varsProfesional:LoadVars = new LoadVars();
var varsProfesional_respuesta:LoadVars = new LoadVars();
varsProfesional.onLoad = function(exito)
{
if (exito)
{
msg = "Variables enviadas " + this.respuestaCF;
}
else
{
//Mostrar mensaje de error en el campo de texto
msg = "Error!! :(";
}
};
function enviarVariablesProfesional() {
varsProfesional.usuario = usuario;
varsProfesional.nombre = nombre;
varsProfesional.cif = cif;
varsProfesional.clave = clave;
varsProfesional.telefono1 = telefono1;
varsProfesional.telefono2 = telefono2;
varsProfesional.email = email;
varsProfesional.web = web;
varsProfesional.sendAndLoad("cf/nuevaEmpresa.cfm", varsProfesional_respuesta, "POST");
}
And this is the code in the coldfusion document:
<cfsetting enablecfoutputonly="Yes">
<cfquery name="chekcUsr" datasource="sdes">
SELECT *
FROM tbEmpresas
WHERE cif = '#FORM.cif#'
</cfquery>
<cfif checkUsr.RecordCount NEQ 0>
<cfoutput>
&respuestaCF=notOK&
</cfoutput>
<cfelse>
<cfquery name="empresasQRY" datasource="sdes">
INSERT INTO tbEmpresas(usuario, nombre, cif, clave, telefono1, telefono2, email, web)
VALUES ( '#FORM.usuario#' , '#FORM.nombre#' , '#FORM.cif#' , '#FORM.clave#' , '#FORM.telefono1#' , '#FORM.telefono2#' , '#FORM.email#' , '#FORM.web#')
</cfquery>
<cfoutput>
&respuestaCF=OK&
</cfoutput>
</cfif>
Thank you all in advance for this great site!