I’d say that I’ve spent more than 4 hours trying to figure out this one, tiny thing.
The form won’t send an email.
I’ve tried three different PHP/Flash Form tutorials:
http://www.gotoandlearn.com/
http://www.kirupa.com/developer/actionscript/flash_php_email.htm
http://ntdesigns.net/tutorial/Mailform.html
I’ve set them up just as I’m instructed, and I’ve checked the forums for a problem like mine, but none of them helped. I’ve seen some threads where people get an email, but it was blank. In my case, I don’t even receive the email.
With each of them, when I click the “Send” button, it doesn’t complete the action. I see that the browser is trying to grab the php file, but it never says “Mail Sent” or whatever it should say if the email has sent.
I’ve tried two free php hosts, and maybe that’s the problem.
coconia.net
flap17.net
And freewebs, but I’m not even sure if that supports PHP.
Does anyone have a free host that, for sure, supports PHP?
Or, otherwise, does anyone have any idea why this might not be working?
This is the code for the “goto and learn” page, which I actually thought would work.
<?php
$to = "qrounded@yahoo.com";
$subject = "Flash Contact Form Submission";
$message = "Name: " . $theName;
$message .= "
Email: " . $theEmail;
$message .= "
Message: " . $theMessage;
$headers = "From: $theEmail";
$headers .= "
Reply-To: $theEmail";
$sentOk = mail($to,$subject,$message,$headers);
echo "sentOk=" . $sentOk;
?>
and here is the Actionscript.
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://jaygou.coconia.net/send.php",receiveLoad);
}
receiveLoad.onLoad = function() {
if(this.sentOk) {
_root.gotoAndStop("success");
}
else {
_root.gotoAndStop("failed");
}
}
Please reply if you have any thoughts.
Thanks.