Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.