I know this has been addressed in the past, and I have tried to follow the examples, but I cannot get this flash contact form to work. Here is the flash code:
fscommand ("allowscale", "false");
fname1.tabIndex = 1;
email1.tabIndex = 2;
comments1.tabIndex = 3;
mailform = "mailform.php";
confirm = "sending ..."
action = "send";
Selection.setFocus("fname");
function validate (address) {
if (address.length>=7) {
if (address.indexOf("@")>0) {
if ((address.indexOf("@")+2)<address.lastIndexOf(".")) {
if (address.lastIndexOf(".")<(address.length-2)) {
return (true);
}
}
}
}
return (false);
}
function formcheck () {
if ((((email == null)) || (email.length<1)) || (email == "ERROR! Address not valid")) {
email = "ERROR! Address not valid";
action = "";
}
if (!validate(email)) {
email = "Address not valid";
action = "";
}
if ((((fname == null)) || (fname.length<1)) || (fname == "ERROR! Address not valid")) {
fname = "Name required";
action = "";
}
if ((validate(email)) && (email != "ERROR!") && (fname != "")) {
action = "send";
loadVariablesNum (mailform, 0, "POST");
gotoAndPlay ("wait");
}
}
stop ();Here is the php code:
// Enter your contact email address here
$adminaddress = "xxx@xxx.net";
// Enter the address of your website here include http://www.
$siteaddress ="http://www.xxx.com";
// Enter your company name or site name here
$sitename = "Contact Form";
/*******************************************************
No need to change anything below ...
*******************************************************/
$date = date("m/d/Y H:i:s");
if ($REMOTE_ADDR == "") $ip = "no ip";
else $ip = getHostByAddr($REMOTE_ADDR);
if ($action != ""):
mail("$adminaddress","Info Request",
"A visitor at $sitename has left the following information\n
Name: $fname
Email: $email
The visitor commented:
------------------------------
$comments
Logged Info :
------------------------------
Using: $HTTP_USER_AGENT
Hostname: $ip
IP address: $REMOTE_ADDR
Date/Time: $date","FROM:$adminaddress");
mail("$email","Thank You for using $sitename",
"If you have requested information, I will respond as soon as possible.\n
Have a healthy day!\n
xxxxx
$sitename,"FROM:$adminaddress");
endif;
?>(added 4/2/08)The flash code above is in the first keyframe. There are 4 additional keyframes with code as follows:
Keyframe: Wait
gotoAndStop(1);
Keyframe: Loop
loadVariables (mailform, 0);
answer = confirm ;
Keyframe: a
if (answer != confirm) {
goAndPlay ("done");
}
Keyframe: done
goAndPlay ("loop")
When the "send" button is pressed, the status bar shows "transferring data from xxx.com..." and the form show "status:sending" and does not change from there. No emails are sent.
Any input would be greatly appreciated.