Current location: Hot Scripts Forums » Programming Languages » PHP » Flash Mail Form with php


Flash Mail Form with php

Reply
  #1 (permalink)  
Old 03-25-06, 11:43 AM
gointern gointern is offline
New Member
 
Join Date: Mar 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Flash Mail Form with php

what is needed to be enabled to pass variables to php? my flash script doesnt seems to pass variables to php script and mail comes empty. do i need to enable something on server side?

Attach Code

PHP SCRIPT
PHP Code:

<?

  $to 
"email@address.com";
  
$msg "$name";
  
$msg .= "$message";
  
mail($to$subject$msg);
?>
FLASH BUTTON:
Code:
on (release) {
	if (name eq "" or subject eq "" or message eq "" or email eq "") {
		stop();
	} else {
		loadVariablesNum("form.php", 0, "POST");
		gotoAndStop(2);
	}
}

Last edited by Christian; 03-30-06 at 08:42 AM.
Reply With Quote
  #2 (permalink)  
Old 03-30-06, 05:07 AM
UnrealEd's Avatar
UnrealEd UnrealEd is offline
Community Liaison
 
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
don't you have to use the sendAndLoad functions in flash?
here's the AS code
Code:
var maildata:Object = new Object();
maildata.post = name.text+"\n"+post.text;
maildata.subject = subject.text;
var toSend:LoadVars = new LoadVars()
toSend.sendAndLoad("http://../form.php", maildata);
toSend.onLoad = function(){
     var success:Boolean = Boolean(this.success);
     if(success){
          trace("mail send");
     }else{
          trace("error in sending mail");
     }
};
this is the php code:
PHP Code:

$to "myemail#foo.bar";

$subject $_POST["subject"];
$message $_POST["message"];

if(
mail($to$subject$message)){
    echo 
"success=true";
}else{
    echo 
"success=false";

Greetz,
UnrealEd
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks

Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
2 profitable script sites for sale cms-master.com General Advertisements 3 07-03-07 10:17 AM
PHP multi-dimensional array sorting issue aqw PHP 2 06-24-05 11:09 PM
PhP Mail Form nuzzle PHP 0 12-09-04 12:56 PM
flash mx to PHP to flash mx olm75 PHP 1 12-09-04 03:44 AM
Attach files to your form mail using PHP OMID SOFT Script Requests 0 04-17-04 07:26 PM


All times are GMT -5. The time now is 07:06 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.