View Full Version : PHP & Flash MX mail form trouble
Ryall
May 6th, 2003, 03:44 PM
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 = "rwalsh@grafikdesigns.com";
$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> \r\n";
$address .= "Address: $address
$message .= "Jump Type: $jumpType \r\n";
$header = "From: $name <$email>";
$message = "$comments \r\n";
mail($to, $subject, $message, $header);
?>
ORDER FORM .FLA (http://www.grafikdesigns.com/orderForm.fla)
Any suggestions on this code or an entirely new idea would be great.
Peace
shuga
May 6th, 2003, 04:58 PM
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
Jubba
May 6th, 2003, 06:00 PM
If you just copied and pasted the code then there was an error. I fixed it. try it now.
<?
$to = "rwalsh@grafikdesigns.com";
$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> \r\n";
$address .= "Address: $address";
$message .= "Jump Type: $jumpType \r\n";
$header = "From: $name <$email>";
$message .= "$comments \r\n";
mail($to, $subject, $message, $header);
?>
Jubba
May 6th, 2003, 06:00 PM
oh, and repost the FLA because I can't download that one for some reason.
Ryall
May 6th, 2003, 06:18 PM
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
senocular
May 6th, 2003, 06:41 PM
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 ;))
Ryall
May 6th, 2003, 06:50 PM
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 :P
senocular
May 6th, 2003, 06:54 PM
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.
Ryall
May 8th, 2003, 03:40 PM
hey Jubba were you able to look at my .fla??
Jubba
May 8th, 2003, 05:57 PM
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...
Ryall
May 10th, 2003, 03:42 AM
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.
comicGeek
May 10th, 2003, 10:47 PM
Hey Jubba, I notice a "." beffore your "=" sign. what's that supposed to do?
comicGeek
May 10th, 2003, 10:52 PM
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?
Ryall
May 11th, 2003, 02:00 PM
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
Jubba
May 11th, 2003, 02:05 PM
Ryall, its still not letting me download it. I download it and save it as a .fla but Flash refuses to open it up.
Ryall
May 12th, 2003, 02:57 PM
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.
Jubba
May 13th, 2003, 07:23 PM
<?
$to = "bohicaorf@yahoo.com";
$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> \r\n";
$address .= "Address: $address";
$message .= "Jump Type: $jumpType \r\n";
$header = "From: $name <$email>";
$message .= "$comments \r\n";
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.
Ryall
May 13th, 2003, 07:55 PM
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
Jubba
May 13th, 2003, 08:06 PM
Yeah, your file is set up a little strange... the actual PHP code is at least... I would do something like this:
<?
$to = "bohicaorf@yahoo.com";
$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> \r\n";
$message .= $address . "\r\n" . $city . " \r\n " . $rentalDate;
$message .= "\r\nJump Type: $jumpType\r\n";
$message .= "$comments \r\n";
$header = "From: $name <$email>";
mail($to, $subject, $message, $header);
?>
try that... that might work...
Ryall
May 15th, 2003, 04:14 PM
thanks... I'll give it a try today.
My PHP skills are obviously lacking - but hopefully that'll change
Ryall
May 23rd, 2003, 04:18 PM
hmmm it still isn't sending all the info.... any advice??
Peace
Jubba
May 23rd, 2003, 09:30 PM
what information isn't it sending and what is your code? It does send the e-mail tho right? Thats the important part...
Ryall
May 26th, 2003, 02:40 PM
it sends an email to the specified address... but only includes the information entered in 2 fields (and there are a lot more)... as this is a "request for order form" all order info needs to be sent as well - see what I mean. I've been looking at it, but dont have anything yet.... let me know if you have any ideas. Thanks for your help!
Peace
Ryall
May 26th, 2003, 02:45 PM
I guess the part that is confusing me is the second part of the code:
$message = "Order Request From $name <$email> \r\n";
$message .= $address . "\r\n" . $city . " \r\n " . $rentalDate;
$message .= "\r\nJump Type: $jumpType\r\n";
$message .= "$comments \r\n";
$header = "From: $name <$email>";
...I have an idea that I will try right now, but this is definitly the part that is causing me trouble, so once again suggestions would sweet... or maybe this isn't that part and my limited PHP knowledge is killing my efforts - let me know ;)
Peace
Jubba
May 30th, 2003, 10:24 AM
The reason some of your variables aren't showing up, is becuase you aren't using some of them in your code. you're missing some.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.