Jump to content

PHP Mail + Flash


titrokb

Recommended Posts

Hey I have had trouble making a flash website with a contact form.

The PHP script works along with the SWF but only when the SWF is on my computer and the PHP is on the server.  If I try to do it while the SWF is on the server it fails.

 

PHP Code:

<?PHP

$to = "######@live.com";
$subject = "####### Form";
$message = "Name:\n " . $theName;
$message .= "\nEmail:\n " . $theEmail;
$message .= "\n\nMessage: \n" . $theMessage;
$headers = "From: $theEmail";
$headers .= "\nReply-To: $theEmail";

$sentOk = mail($to,$subject,$message,$headers);

echo "sentOk=" . $sentOk;

?>

 

Action Script:

stop();

var senderLoad:LoadVars = new LoadVars();
var receiveLoad:LoadVars = new LoadVars();

sender.onRelease = function() {
senderLoad.theName = theName.text;
senderLoad.theEmail = theEmail.text;
senderLoad.theMessage = theMessage.text;
senderLoad.sendAndLoad("http://############.com/send.php",receiveLoad);
}

receiveLoad.onLoad = function() {
if(this.sentOk) {
	_root.gotoAndStop("success");
}
else {
	_root.gotoAndStop("failed");
}
}

 

All this works until I try to access the form when its uploaded on the server.

Please help me.

Link to comment
https://forums.phpfreaks.com/topic/133758-php-mail-flash/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.