Hello all
I purchased a template and i am missing the php script for the mail form.
The template was done in flash i will post the AS in flash for the mail form.
I also found a php mail script, i am not sure where to add the variables from flash into the php script. Maybe someone can point it out where to add my variables into the php.
Thanks
Bendeguz
my variables in flash are:
txtName=namex is the Var
txtMail=emailx
txtPhone=phonex
txtMessage=commx
This is the php script i found and hope it will work with the flash.
<?php
// IMPORTANT NOTE: DO NOT change anything that has a $ before it
// Any line that has two slashes in front of it is a comment (and will be ignored by this script)
/*
// In case register globals is off (backwards compatibility)
// If you add additional input text fields - you need to add them here as well
// for example, if you add a text field with a variable "Phone", add:
// $phone = $HTTP_POST_VARS['Phone'];
// Remember -- you would then also need to add them in the 'Remove Slashes' section
// as $phone (for example), and somewhere in the 'msg_body' below
// I have added this example in to the script below to help give you a guide
*/
$message = $HTTP_POST_VARS['Message'];
$name = $HTTP_POST_VARS['Name'];
$email = $HTTP_POST_VARS['Email'];
$phone = $HTTP_POST_VARS['Phone'];
// Begin Censors
$message = eregi_replace('****', "flip", $message);
$message = eregi_replace('****', "crap", $message);
$message = eregi_replace('*****', "nice lady", $message);
$message = eregi_replace('ass', "butt", $message);
$message = eregi_replace('piss', "pee", $message);
// End Censors
// Remove Slashes Inserted by PHP
$name = stripslashes($name);
$email = stripslashes($email);
$phone = stripslashes($phone);
$message = stripslashes($message);
// Start Customizable Email Information
// Change the information in quotes below to fit your needs
$rec_email = "kmajszki@mountaincable.net"; // who do you want to send this email to
$subject = "Form From Web Page"; // this is the subject line of the email
// End Customizable Email Information
// The Body of the Email message
// You can customize the email you receive by changing the text inside the quotes below
// The code "\n" (without quotes) will add a new line in the email body
// Don't forget to add extra '$msg_body .='
// for each additional input field you have added to your form
// IMPORTANT NOTE: DO NOT change anything that has a $ before it
$msg_body = "Message from $SERVER_NAME\n";
$msg_body .= "*****************************************\n";
$msg_body .= "Name: $name\n";
$msg_body .= "E-Mail: $email\n";
$msg_body .= "Phone: $phone\n";
$msg_body .= "*****************************************\n";
$msg_body .= "Message: $message\n";
$msg_body .= "\n\n";
$msg_body .= "\n\n";
$msg_body .= "\n\n";
$msg_body .= "\n\n";
$msg_body .= "*****************************************\n";
$msg_body .= "\n\n";
$msg_body .= "Additional Sender Information\n";
$msg_body .= "*****************************************\n";
$msg_body .= "IP Address: $REMOTE_ADDR\n";
$HostName = gethostbyaddr($_SERVER['REMOTE_ADDR']);
$msg_body .= "Host: $HostName\n";
$msg_body .= "User Agent: $HTTP_USER_AGENT\n";
$msg_body .= "*****************************************\n";
// Add Some Extra Header Information to the Mail
$header_info = "From: ".$name." <".$email.">";
// Now let's take the information above and mail it to the recipient
mail($rec_email, $subject, $msg_body, $header_info);
?>
function validateEmail(strEmail)
{
return (strEmail.indexOf("@") < 2 || strEmail.lastIndexOf(".") <= strEmail.indexOf("@") + 2 || strEmail.lastIndexOf(".") > strEmail.length - 3 || strEmail.length < 8 ? (false) : (true));
} // End of the function
function clearForm()
{
new mx.transitions.Tween(txtName, "_alpha", mx.transitions.easing.Regular.easeOut, txtMail._alpha, 0, 5.000000E-001, true);
new mx.transitions.Tween(txtMail, "_alpha", mx.transitions.easing.Regular.easeOut, txtMail._alpha, 0, 5.000000E-001, true);
new mx.transitions.Tween(txtPhone, "_alpha", mx.transitions.easing.Regular.easeOut, txtMail._alpha, 0, 5.000000E-001, true);
var _loc1 = new mx.transitions.Tween(txtMessage, "_alpha", mx.transitions.easing.Regular.easeOut, txtMail._alpha, 0, 5.000000E-001, true);
_loc1.onMotionFinished = function ()
{
txtMessage.text = "Message";
txtName.text = "Name";
txtMail.text = "Email";
txtPhone.text = "Phone";
new mx.transitions.Tween(txtName, "_alpha", mx.transitions.easing.Regular.easeOut, txtMail._alpha, 100, 5.000000E-001, true);
new mx.transitions.Tween(txtMail, "_alpha", mx.transitions.easing.Regular.easeOut, txtMail._alpha, 100, 5.000000E-001, true);
new mx.transitions.Tween(txtPhone, "_alpha", mx.transitions.easing.Regular.easeOut, txtMail._alpha, 100, 5.000000E-001, true);
new mx.transitions.Tween(txtMessage, "_alpha", mx.transitions.easing.Regular.easeOut, txtMail._alpha, 100, 5.000000E-001, true);
};
} // End of the function
stop ();
mcolorx = _root.mcolorx;
new Color(_Error1).setRGB(mcolorx);
new Color(_Error2).setRGB(mcolorx);
new Color(_Error3).setRGB(mcolorx);
new Color(_Error4).setRGB(mcolorx);
btnOver = function (MC)
{
new mx.transitions.Tween(MC._txtMC, "_alpha", normal, MC._txtMC._alpha, 50, 2.000000E-001, true);
};
btnOut = function (MC)
{
new mx.transitions.Tween(MC._txtMC, "_alpha", normal, MC._txtMC._alpha, 100, 2.000000E-001, true);
};
_Nxt.btn.onRollOver = function ()
{
btnOver(_Nxt);
};
_Nxt.btn.onRollOut = function ()
{
btnOut(_Nxt);
};
stop ();
txtName.onSetFocus = function ()
{
if (txtName.text == "Name")
{
txtName.text = "";
} // end if
};
txtName.onKillFocus = function ()
{
if (txtName.text == "" || txtName.text == " ")
{
txtName.text = "Name";
new mx.transitions.Tween(txtName, "_alpha", mx.transitions.easing.Regular.easeOut, 0, 100, 5.000000E-001, true);
} // end if
};
txtMail.onSetFocus = function ()
{
if (txtMail.text == "Email")
{
txtMail.text = "";
} // end if
};
txtMail.onKillFocus = function ()
{
if (txtMail.text == "" || txtMail.text == " ")
{
txtMail.text = "Email";
new mx.transitions.Tween(txtMail, "_alpha", mx.transitions.easing.Regular.easeOut, 0, 100, 5.000000E-001, true);
} // end if
};
txtPhone.text = "Phone";
txtPhone.onSetFocus = function ()
{
if (txtPhone.text == "Phone")
{
txtPhone.text = "";
} // end if
};
txtPhone.onKillFocus = function ()
{
if (txtPhone.text == "" || txtMessage.text == " ")
{
txtPhone.text = "Phone";
new mx.transitions.Tween(txtPhone, "_alpha", mx.transitions.easing.Regular.easeOut, 0, 100, 5.000000E-001, true);
} // end if
};
txtMessage.text = "Message";
txtMessage.onSetFocus = function ()
{
if (txtMessage.text == "Message")
{
txtMessage.text = "";
} // end if
};
txtMessage.onKillFocus = function ()
{
if (txtMessage.text == "" || txtMessage.text == " ")
{
txtMessage.text = "Message";
new mx.transitions.Tween(txtMessage, "_alpha", mx.transitions.easing.Regular.easeOut, 0, 100, 5.000000E-001, true);
} // end if
};
_Nxt.btn.onRelease = function ()
{
if (txtName.text == "Name")
{
new mx.transitions.Tween(txtName, "_alpha", mx.transitions.easing.Regular.easeOut, 0, 100, 5.000000E-001, true);
}
else if (!validateEmail(txtMail.text))
{
new mx.transitions.Tween(txtMail, "_alpha", mx.transitions.easing.Regular.easeOut, 0, 100, 5.000000E-001, true);
}
else if (txtPhone.text == "Phone")
{
new mx.transitions.Tween(txtPhone, "_alpha", mx.transitions.easing.Regular.easeOut, 0, 100, 5.000000E-001, true);
}
else if (txtMessage.text == "Message")
{
new mx.transitions.Tween(txtMessage, "_alpha", mx.transitions.easing.Regular.easeOut, 0, 100, 5.000000E-001, true);
}
else
{
loadVariablesNum("MailPHP.php", 0, "POST");
clearForm();
clearForm();
} // end else if
};