PHP & Flash MX mail form trouble

Ok, I’ve made mail forms in flash 5 before and they all worked fine… but for some reason I cannot get this one to work to save my life… I’ve gone through the threads on this topic, but to no avail. I’ve attached the .fla - none of the PHP scripts I’ve been writing worked so I’d like some one to help me start a new one from scratch.

Basically all I want is an email sent to a preset address containing the info provided by the form.

Here is the PHP script I am currently working on… but making so many different ones I’ve gotten cunfused I guess.

<?
$to = "[email protected]";
$subject = "Request For Order";
$name = $_POST['name'];
$address = $_POST['address'];
$city = $_POST['city'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$rentalDate = $_POST['rentalDate'];
$jumpType = $_POST['jumpType'];
$comments = $_POST['comments'];

$message .= "Order Request From $name <$email> 
";
$address .= "Address: $address
$message .= "Jump Type: $jumpType 
";
$header = "From: $name <$email>";
$message = "$comments 
";

mail($to, $subject, $message, $header);

?>

ORDER FORM .FLA

Any suggestions on this code or an entirely new idea would be great.

Peace

check out this thread … this is where i figured out how to do it.
http://www.kirupaforum.com/forums/showthread.php?s=&threadid=17623

if you still can’t figure it out i can give you my source, although i’m pretty sure it’s all in that thread if you read through it.

i don’t know php really so i can’t really help beyond that. i understand how it interacts with flash, but as far as coding it, i’m a newb =)

hope this helps

If you just copied and pasted the code then there was an error. I fixed it. try it now.


<?
$to = "[email protected]";
$subject = "Request For Order";
$name = $_POST['name'];
$address = $_POST['address'];
$city = $_POST['city'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$rentalDate = $_POST['rentalDate'];
$jumpType = $_POST['jumpType'];
$comments = $_POST['comments'];

$message .= "Order Request From $name <$email> 
";
$address .= "Address: $address";
$message .= "Jump Type: $jumpType 
";
$header = "From: $name <$email>";
$message .= "$comments 
";

mail($to, $subject, $message, $header);

?>

oh, and repost the FLA because I can’t download that one for some reason.

Hey Jubba thanks… try the link in the first post now for the .fla… for some reason it wont download auto from my server (I’ll have to look into this), but you can right click and save target as… (be sure to make the extension fla, my computer kept trying to save it as an html file - man I guess theres always something to deal with).

Let me know what you find out by looking at my fla

Peace

was that link to jubbas tut? Thats one to check out. Im a little late into this but I thought Id throw that out there (and jubba’s already entered the fray so I guess really I have no business here ;))

yeah I looked at jubbas tut, plus a bunch of threads where he helped people out with similar ?'s but I haven;t had success yet. I think I’ve written and rewritten the code and fla so many different ways that I have my head tied in a knot, I think I just need some one-on-one with someone to help me get this working. It is a great tut though, I just cant seem to tweak it to work for me. grrrrr well practice makes perfect in trying to learn PHP!

Peace :stuck_out_tongue:

the more of this you go through, the more adept you will be in the end. Its a hassel at first, but it will pay off when this kind of experience makes more knowledgable about this kind of stuff.

hey Jubba were you able to look at my .fla??

nope I forgot about this thread because I’ve been busy lately. I will be able to take a look tomorrow night after all my papers are in…

thanks man!

I’ve been messing with it, but without results yet… I’ll let you know if anything changes - looking forward to hearing what you have to say about it all…

Peace, and thanks again.

Hey Jubba, I notice a “.” beffore your “=” sign. what’s that supposed to do?

I’ve been making contact forms like these before and it’s great. But I’m bored. I want to convert the message sent to my inbox to HTML so I can add colors tables the like. But how can I do this. At first I thought it was easy to do using only HTML but I was wrong. It never worked I just receive the mail with all the HTML tag visible! Anyone knows how to do this?

It depends on your mail server… it has to support html, some don’t so no matter what you will be able to see the tags - thats all I really know on the subject

Ryall, its still not letting me download it. I download it and save it as a .fla but Flash refuses to open it up.

hmmmm I dunno what the deal is… try this link:

www.grafikdesigns.com/JUBBA/orderForm.fla

I updated the file and made sure it downloaded from a few different computers… let me know if it works.

Peace

PS. again you have to save it, and on some computers it is still attempting to be saved as a html file so you have to change that - but it works… well I hope it does for you. If it still doesn’t I’ll need to look into this, cuz something is not right. It is an MX file that uses a component, but I am 99.99% sure you have MX, but I thought it was worth mentioning in case it was over looked.


<?
$to = "[email protected]";
$subject = "Request For Order";
$name = $_POST['name'];
$address = $_POST['address'];
$city = $_POST['city'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$rentalDate = $_POST['rentalDate'];
$jumpType = $_POST['jumpType'];
$comments = $_POST['comments'];

$message .= "Order Request From $name <$email> 
";
$address .= "Address: $address";
$message .= "Jump Type: $jumpType 
";
$header = "From: $name <$email>";
$message .= "$comments 
";

mail($to, $subject, $message, $header);

?>


Ok, now that code did work for me. It sent an e-mail to my account, from the SWF file. Hopefully it will work for you.

Thanks Jubba, I used it and it did send an email, however the email did not show the information entered in the form, only the header info… nothing else like name, address, etc. Any ideas as to why?

Peace

Yeah, your file is set up a little strange… the actual PHP code is at least… I would do something like this:


<?
$to = "[email protected]";
$subject = "Request For Order";
$name = $_POST['name'];
$address = "Address: " . $_POST['address'];
$city = $_POST['city'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$rentalDate = $_POST['rentalDate'];
$jumpType = $_POST['jumpType'];
$comments = $_POST['comments'];

$message = "Order Request From $name <$email> 
";
$message .= $address . "
" . $city . " 
 " . $rentalDate;
$message .= "
Jump Type: $jumpType
"; 
$message .= "$comments 
";
$header = "From: $name <$email>";


mail($to, $subject, $message, $header);

?>

try that… that might work…

thanks… I’ll give it a try today.

My PHP skills are obviously lacking - but hopefully that’ll change