...

View Full Version : Action scrip working but need help with PHP mail please



vanessia1999
09-27-2012, 07:04 PM
Hi all. I have been working on a action script for a long time and finally got it working. I am totally lost of how to write my PHP email codes for when the person press submit all the information they fill in is sent to me via email could someone help me please. I found tons of example off the internet to write a basic one but nothing close to what I have. Could someone please help me. Below is my action script code I use.

[import fl.controls.*;
import fl.controls.RadioButtonGroup;

//This sets a group name for the radio button instances.
var myradioGroup:RadioButtonGroup = new RadioButtonGroup("RadioButtonGroup");

//This assigns the radio button instances to the radio group.
cRadio1.group = myradioGroup;
cRadio2.group = myradioGroup;

submit_btn.addEventListener(MouseEvent.CLICK, submitFunc);
var radBtns = [cRadio1,cRadio2];
var errorsNum = 0;
function submitFunc(e:MouseEvent)
{
var finalData = "";
var errorFlag = "Followings errors were found.\n";
if (name_txt.text == "")
{
errorsNum++;
errorFlag += errorsNum+". Enter ur name.\n";
}
if (email_txt.text == "")
{
errorsNum++;
errorFlag += errorsNum+". Enter ur email.\n";
}
if (mobile.text == "")
{
errorsNum++;
errorFlag += errorsNum+". Enter ur phone number.\n";
}
if (!myradioGroup.selection)
{
errorsNum++;
errorFlag += errorsNum+". Select ur gender.\n";
}

if (age.selectedIndex < 0)
{
errorsNum++;
errorFlag += errorsNum+". Select any of the course.\n";
}
if (!orangecb.selected)
{
errorsNum++;
errorFlag += errorsNum+". Please check one";
}
if (!orangelcb.selected)
{
errorsNum++;
errorFlag += errorsNum+". Please check one";
}

if (message_txt.text == "")
{
errorsNum++;
errorFlag += errorsNum+". Enter ur message.\n";
}

if (errorsNum > 0)
{
mytxt.text = errorFlag;
errorFlag = "";
errorsNum = 0;
return false;
}

else
{
finalData += "Thank you "+name_txt.text+" for contacting me! I will call you at "+mobile.text+", "+"else I can mail you also at "+email_txt.text+" in "+applecb.selected+"response "+orangecb.selected+" of your message "+message_txt.text+"\n\n Your other information is, you're a "+myradioGroup.selection.value+" and is between "+age.value+"\nThanks";
mytxt.text = finalData;
}
}

]

djpaul1963
09-27-2012, 11:18 PM
You miss a lot and I don't think your script will ever compile succesfully because you left outside valuable piece of code.
For example, you add a listener to a button where your submit will begin with this line:

submit_btn.addEventListener(MouseEvent.CLICK, submitFunc);

BUT the function itself is nowhere inside your code (or at least the part you pasted here)

I am afraid you are wasting your time unfortunately..

vanessia1999
09-28-2012, 12:08 AM
Oh no, please don't say that. I been working on this with lack of sleep for while. I test it in Flash of my browser once open and it seems to work. Above is all of the code that I used. May I ask what is wrong with the submit_btn.addEventListener(MouseEvent.CLICK, submitFunc); I thought that was my function for once the button is click on the information is sent to me? May I ask what function should it be then or better yet what is missing?

djpaul1963
09-28-2012, 12:07 PM
I didn't want to disappoint you, I am sorry for that.
Your code in fact includes the body of the function, my bad.
What you need right now is the .php file as you say, but unforunately I can't help on that because I use ASP.NET as application server :(

vanessia1999
09-28-2012, 07:58 PM
Hi DjPaul, thank you. I was like oh man back to the drawing board. It is okay. I do appreciate you trying to help.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum