Hi, I have a form set up in flash pointing to a PHP script on my webspace.
I checked the PHP script and when viewed in a browser it returns the parameters OK so I presume it is working.
My problem is the variables captured by user input are not being sent to me.
Please can anyone check my actionscript below for errors.
I have tried send() and sendAndLoad() so I feel I may have an issue with my LoadVars.
Thanks in advance.
stop();
var fullName:TextFi eld;
var fullAddress:Tex tField;
var postcode:TextFi eld;
var telNumber:TextF ield;
var emailAddress:Te xtField;
fullName.restri ct = "A-Za-zÁáÉéêíÍãõç ";
fullName.maxCha rs = 40;
fullAddress.res trict = "0-9A-Za-zÁáÉéêíÍãõç!?.+ \- ";
fullAddress.max Chars = 90;
postcode.restri ct = "0-9A-Za-zÁáÉéêíÍãõç!?.+ \- ";
postcode.maxCha rs = 10;
telNumber.restr ict = "0-9A-Za-zÁáÉéêíÍãõç!?.+ \- ";
telNumber.maxCh ars = 20;
emailAddress.re strict = "0-9A-Za-zÁáÉéêíÍãõç!?.+ \- ";
emailAddress.ma xChars = 50;
function sendEmail(fullN ame, fullAddress, postcode, telNumber, emailAddress)
{
var myData:LoadVars = new LoadVars();
myData.fullName = fullName.text;
myData.fullAddr ess = fullAddress.tex t;
myData.postcode = postcode.text;
myData.telNumbe r = telNumber.text;
myData.emailAdd ress = emailAddress.te xt;
}
this.submitButt on.onRelease = function()
{
if (fullName.text == "" || fullAddress.tex t == "" || postcode.text == "" || telNumber.text == "")
{
gotoAndStop("er ror");
}
else
{
sendEmail();
gotoAndStop("co rrect");
}
myData.send("ht tp://www.mywebsite.c o.uk/iopost.php", "POST");
};
I checked the PHP script and when viewed in a browser it returns the parameters OK so I presume it is working.
My problem is the variables captured by user input are not being sent to me.
Please can anyone check my actionscript below for errors.
I have tried send() and sendAndLoad() so I feel I may have an issue with my LoadVars.
Thanks in advance.
stop();
var fullName:TextFi eld;
var fullAddress:Tex tField;
var postcode:TextFi eld;
var telNumber:TextF ield;
var emailAddress:Te xtField;
fullName.restri ct = "A-Za-zÁáÉéêíÍãõç ";
fullName.maxCha rs = 40;
fullAddress.res trict = "0-9A-Za-zÁáÉéêíÍãõç!?.+ \- ";
fullAddress.max Chars = 90;
postcode.restri ct = "0-9A-Za-zÁáÉéêíÍãõç!?.+ \- ";
postcode.maxCha rs = 10;
telNumber.restr ict = "0-9A-Za-zÁáÉéêíÍãõç!?.+ \- ";
telNumber.maxCh ars = 20;
emailAddress.re strict = "0-9A-Za-zÁáÉéêíÍãõç!?.+ \- ";
emailAddress.ma xChars = 50;
function sendEmail(fullN ame, fullAddress, postcode, telNumber, emailAddress)
{
var myData:LoadVars = new LoadVars();
myData.fullName = fullName.text;
myData.fullAddr ess = fullAddress.tex t;
myData.postcode = postcode.text;
myData.telNumbe r = telNumber.text;
myData.emailAdd ress = emailAddress.te xt;
}
this.submitButt on.onRelease = function()
{
if (fullName.text == "" || fullAddress.tex t == "" || postcode.text == "" || telNumber.text == "")
{
gotoAndStop("er ror");
}
else
{
sendEmail();
gotoAndStop("co rrect");
}
myData.send("ht tp://www.mywebsite.c o.uk/iopost.php", "POST");
};