Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Flash CS3 mail via PHP
Old 08-11-2008, 03:34 PM Flash CS3 mail via PHP
Novice Talker

Posts: 8
Trades: 0
Hey, I'm trying to make my Flash CS3 file send an email through PHP using ActionScript 2.0

However, for some odd reason, it's not working!! Once or twice, it DOES send the email... but just once or twice (I can't seem to find any pattern) -- but even then all the variables show up us empty.

Here's the code for the ActionScript in Flash:

Code:
on(release){
    var sendInfo:LoadVars = new LoadVars();
    var getInfo:LoadVars = new LoadVars();

    //Readying variables to send
    sendInfo.cust_name = _root.nameInput.text;
    sendInfo.cust_mail = _root.mailInput.text;
    sendInfo.cust_phone = _root.phoneInput.text;
    sendInfo.cust_msg = _root.msgInput.text;
    //Sending variables to PHP handler
    sendInfo.sendAndLoad("mail.php", getInfo, "POST");
}
And here's the PHP:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled</title>
</head>
<body>
<!-- PHP Mail Coding starts here -->
<?php
session_start();

$name=$_POST['cust_name'];
checkOK($name);
$email=$_POST['cust_mail'];
checkOK($email);
$msg=$_POST['cust_msg'];
checkOK($msg);

$msg = str_replace("\n", "<br>", $msg);
$msg = str_replace("\r", "<br>", $msg);

$phone=$_POST['cust_phone'];
$to='myemail@whatever.com'; //Mail will be sent to e-mail address

$message="
<HTML>
<head>
  <title>Feedback Form Mail</title>
</head>
<body>
<font color=red><b> $name </b></font>just filled in your contact form.<br>
E-Mail:<font color=blue><b> $email </b></font><br>
Phone:<b> $phone </b><br>
They said:<br>
<h4>
$msg
<br></h4>

</body></HTML>
";
// Content-type header for HTML e-mail
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
mail($to,'Comments From Your Site',$message,$headers);

?>
</body>
</html>
Can someone PLEASE help me out?

Last edited by uttaresh; 08-12-2008 at 05:34 PM..
uttaresh is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to Flash CS3 mail via PHP
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.27558 seconds with 12 queries