# Php mail with flash

**URL:** <https://forum.kirupa.com/t/php-mail-with-flash/277606>\
**Category:** Uncategorized\
**Created:** [December 14, 2008, 7:48pm UTC](https://forum.kirupa.com/t/php-mail-with-flash/277606 "2008-12-14T19:48:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bendeguz](https://avatars.discourse-cdn.com/v4/letter/b/e9bcb4/32.png) [@Bendeguz](https://forum.kirupa.com/u/Bendeguz)\
**Post date:** [December 14, 2008, 7:48pm UTC](https://forum.kirupa.com/t/php-mail-with-flash/277606/1 "2008-12-14T19:48:43Z")

</div>

hello all  
I have a little problem, I have purchased a flash template but when i opened the mail.php  
i had just one line in it. I read the instructions hoe to change the mail address to mine but there was nothing like that inside the php script.  
I actually took the script from flash this is the action script for the form:

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

```

};

Now the php scipt only has this line:

\_root.Status=success

I am not a php programer but i found a script that might work, i am not sure thou this would be the script i found that might work:

\<?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('**_’, “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 "  
" (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  
";  
$msg\_body .= "\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
";  
$msg\_body .= "Name: $name  
";  
$msg\_body .= "E-Mail: $email  
";  
$msg\_body .= "Phone: $phone  
";  
$msg\_body .= "\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
";  
$msg\_body .= "Message: $message  
";  
$msg\_body .= "

";  
$msg\_body .= "

";  
$msg\_body .= "

";  
$msg\_body .= "

";  
$msg\_body .= "\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
";  
$msg\_body .= "

";  
$msg\_body .= "Additional Sender Information  
";  
$msg\_body .= "\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
";  
$msg\_body .= "IP Address: $REMOTE\_ADDR  
";  
$HostName = gethostbyaddr($\_SERVER[‘REMOTE\_ADDR’]);  
$msg\_body .= "Host: $HostName  
";  
$msg\_body .= "User Agent: $HTTP\_USER\_AGENT  
";  
$msg\_body .= "\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
";

// 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);

?\>

I also will attach the screen shot from flash just to be sure what are the variables because i am not sure.

I hope someone will be able to help because i have not received any emails from the people i bought the template off of in 2 weeks now. Any help would be appreciated.
