It is currently Fri Mar 29, 2024 6:05 am


All times are UTC


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Flash PHP mailform. . .
PostPosted: Mon Aug 04, 2008 7:28 pm 
Newbie
Newbie

Joined: Mon Aug 04, 2008 6:50 pm
Posts: 2
I've had a LOT of trouble getting a PHP mailform to work on the server. I've looked at the FAQ under PHP/Pearl Settings, but it only addresses formmail PHP scripts, and I'm using a PHP form that is communicating with a .swf form using Actionscript. The following is the code I'm trying to use.

PHP:
Code:
<?PHP

$to = "mailexamplephp@yahoo.com";
$subject = "Flash Contact Form Submission";
$message = "Name:".$theName;
$message .= "\nEmail:".$theEmail;
$message .= "\n\nMessage:".$theMessage;
$headers = "From: $theEmail";
$headers .= "\nReply-To: $theEmail";

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

echo "sentOk=".$sentOk;

?>


And here's the corresponding Actionscript inside the mailform:
Code:
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://leebrimelow.com/mailExample/send.php",receiveLoad);
}

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


This is the code from the tutorial I've used - I'm at work right now. But in my code, I have the email being sent to my freehostia email address, which is forwarding to my personal email. Just can't get it to work at all. When I enter info on the mailform and submit it, the mail just dead-ends as soon as it hits the PHP. Please help!!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 05, 2008 2:00 pm 
Newbie
Newbie

Joined: Mon Aug 04, 2008 6:50 pm
Posts: 2
Ok, I know it's not missing. look at line 8 (beginning of the variable "headers"). It's right there, and then it's used further down in the mail() function. It's not a big deal, I figured it out last night. This script works fine, it's just that I have to use it with an email in the EXACT SAME domain as I'm hosting the PHP script in.

For those who don't understand Freehostia's policy:

You MUST host your PHP script under the same domain as the email you're sending to. I have two distinct domain names, and I've been trying to use MY main email, under my domain, when setting up a Flash/PHP mailform for my wife's photography site, which is under a different domain. Kinda stupid, I know, but not a huge deal - if it's a problem, just forward the mail to your main inbox like I am. Cheers! :wink:


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ]  Moderators: Moderators, Support Team

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Hosting | Domains | Servers | Extras | Order | Support | Contacts | FreeHostia © 2011