Jump to content

Having trouble setting up flash based contact form.


pnutbuttrjarz

Recommended Posts

Hey guys......

I have an already completed flash website for my business (a 1.65mb swf file inserted into a table on a html page).

On the swf file is a contact form page that looks like this:

eca4abba7d.jpg

 

Basically all I want this to be able to do is the customer/client fill out the fields of the contact form and hit send and it sends whatever was written to my email address.

 

I previously figured out that I needed some sort of php script to enable whatever was typed in the fields to be emailed to my address.

I have already asked this question at one of my other forums I hang out at (not a website or php designed forum), and only got 1 response.

 

This is what was posted:

First of all you need to make sure you have php webhosting and smtp or pop3 mail server which allow you send mail by php.
Once you have follow this:

--------------------------
In flash:

var mailSendLV:LoadVars = new LoadVars();
var mailReceiveLV:LoadVars = new LoadVars();
mailSendLV.name ="yyy";
mailSendLV.e-mail = "[email protected]";
mailSendLV.message= "Hello yyy";
//sent this value to php
// suppose you have a sendmail.php
mailReceiveLV.sendAndLoad("http://www.plasturgieducation.org/formations/platurgie_map/sendmail.php",mailReceiveLV,"POST");

// mailReceiveLV use to make sure your mail has been send
mailReceiveLV.onLoad = function (success:Boolean){
if (success){
if(mailReceiveLV.isSent )
trace("your mail has been sent");
else
trace("send false");
}
}

//In PHP code sendmail.php
<?php
$name = htmlentities($_POST['name']);
$to = htmlentities($_POST['e-mail']);
$message = htmlentities($_POST['message']);
$subject = 'yyy';
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: YYY";
if (mail($to, $subject, $message, $headers)) {
// tell flash that your mail already send
echo '&isSend=true&'
}else{
// or it's fail to sent
echo '&isSend=false&'
}
?>

----------------------------------

if you are familiar with basic actionscript and php, you would find it uesful.
This is how actionscipt and php communicate each other.

 

If this script is correct, where is all of this supposed to go??

 

Now i've tried to read thru the tutorials here (phpmailer etc) but have only become more confused.

Now my site will be hosted on a friends webserver, which I am 98% sure is php enabled.

 

Is this something that can be done all thru dreamweaver?? I can get my way around Dreamweaver and flash professional 8 easily enough, but have no idea how to add any of this php scripting. Everything I read just makes me more and more confused. Is this something that is quite simple, or is this a very complex thing?!?!?

 

Any help will be truly appreciated guys.

 

Regards,

Pnut

Archived

This topic is now archived and is closed to further replies.

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