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.