flash actionscript:
I downloaded a Flash file with accompanying php file from the exchange. The
actionscript and php seem pretty straightforward, but I cannot get it to work.
It consists of an HTML page that embeds the .swf and the .php file called to
action from within the .swf. The .swf is an interface that allows someone to
send an email via .php.
The actionscript in my Flash file is as follows:
stop();
System.useCodepage = true;
send_btn.onRelease = function() {
my_vars = new LoadVars();
my_vars.sender = email_box.text;
my_vars.subject = subject_box.text;
my_vars.message = message_box.text;
if (my_vars.sender != "" and my_vars.subject != "" and my_vars.message != "")
{
my_vars.sendAndLoad("mailer.php", my_vars, "POST");
gotoAndStop(2);
} else {
error_clip.gotoAndPlay(2);
}
my_vars.onLoad = function() {
gotoAndStop(3);
};
};
email_box.onSetFocus = subject_box.onSetFocus=message_box.onSetFocus=function
() {
if (error_clip._currentframe != 1) {
error_clip.gotoAndPlay(6);
}
};
The mailer.php file is:
<?php
// read the variables form the string, (this is not needed with some servers).
$subject = $_REQUEST["subject"];
$message = $_REQUEST["message"];
$sender = $_REQUEST["sender"];
$full_message = $_SERVER['REMOTE_ADDR'] . "\n\n" . $message;
$message= $full_message;
/$message = stripslashes($message);
$subject = stripslashes($subject);
$sender = stripslashes($sender);
$subject = "Contact form ". $subject;
if(isset($message) and isset($subject) and isset($sender)){
mail("blahblah@blahblah.net", $subject, $message, "From: $sender");
// the blahblah@ has been replaced with my real email address on the file
residing on my server
// I changed it here for privacy reasons
}
?>
At present, I have all files residing in the root folder.
Any suggestions as to why this isn't working -- something on my php.ini file
perhaps?
Thanks in advance for any/all suggestions.