$sendTo = "Kyle@459productions.com"; $subject = "Web Quote"; $headers = "From: " . $_POST["firstName"] ." ". $_POST["lastname"] . "<" . $_POST["email"] .">\r\n"; $headers .= "Reply-To: " . $_POST["email"] . "\r\n"; $headers .= "Return-path: " . $_POST["email"]; $message = $_POST["message"]; mail($sendTo, $subject, $message, $headers);
PHP Form
#1
Posted 08 December 2007 - 10:53 PM
#2
Posted 08 December 2007 - 11:13 PM
print_r($_POST);
That will show you what is being sent through POST data to PHP. If it only shows your message variable, then there is a problem with your ActionScript and you'll need to show us. If it is there, then there is something else going on, such as possibly not accessing the correct key of the array (example, accessing $_POST['firstName'] when in the form it is sent to $_POST['first_name']).
#3
Posted 08 December 2007 - 11:15 PM
#4
Posted 08 December 2007 - 11:21 PM
Be sure also that your Flash form is sending it by POST protocol, and not GET.
#5
Posted 08 December 2007 - 11:29 PM
My Form Movie Clip has this
onClipEvent(data){
_root.nextFrame();
}
The Send Button Has this
on (release) {
form.loadVariables("email.php", "POST");
}
#6
Posted 08 December 2007 - 11:54 PM
When dealing with emailing, you should test everything for the message and how it will be outputted before sending the message. Otherwise you'll not only waste resources and spam up your inbox, you could get yourself into trouble for spamming on your host if you do it too much and too often at once.
Take out the mail() function (or comment it out atleast) for now, and just focus on getting those variables passed correctly.
#7
Posted 09 December 2007 - 12:37 AM
Now I put it in front as well like you said, so it must be the Action Script then?
#8
Posted 09 December 2007 - 12:51 AM
Try further debugging by outputting the contents of $_GET to see if the data is somehow being sent the wrong way.
#9
Posted 10 December 2007 - 01:01 PM
Any ideas? Anyone?
Edited by rc69, 13 December 2007 - 03:22 PM.
#10
Posted 14 December 2007 - 04:01 AM
I read that you were having some problems with PHP and thought I'd try to help you out. Could you please provide the code that is used for PHP? At this stage, from my understandings, this would only be the form used (unless this is provided within flash itself, in which case ignore this part of the request), and the email.php file.
Let's see if we can fix this sucker!
#11
Posted 14 December 2007 - 12:15 PM
Here is my email.php code and my Flash Actionscript is above as well.
$sendTo = "Kyle@459productions.com"; $subject = "Web Quote"; $headers = "From: " . $_POST["firstName"] ." ". $_POST["lastname"] . "<" . $_POST["email"] .">\r\n"; $headers .= "Reply-To: " . $_POST["email"] . "\r\n"; $headers .= "Return-path: " . $_POST["email"]; $message = $_POST["message"]; mail($sendTo, $subject, $message, $headers);
#12
Posted 17 December 2007 - 01:00 AM
459Productions, on Dec 15 2007, 06:15 AM, said:
Sorry I took so long to reply, it has been a few busy days for me with Christmas creeping ever so closely to being here!
Your PHP script is fine - although the integrity of the script is debatable, since you have no sanitisation checks to make sure people don't just send you a blank email, which is quite possible with the current state of the script. But we'll cross that bridge when we get to it.
Looking up the ActionScript Dictionary on Adobe's site seems to indicate that the potential problem may be your lack of parameters for loadVariables().
loadVariables( " url ", level/ " target " [, variables ])
You have defined the url and the optional variables parameters, but the level or the "target" of the action call doesn't appear to exist. I believe that's a step in the right direction to fixing it.
#13
Posted 17 December 2007 - 02:56 PM
#14
Posted 18 December 2007 - 05:28 AM
One thing you need to understand, is that you pick either the level or the target, it cannot be both. It sounds like you'd be better off to go with the target attribute to that one, and if the documentation is anything to go by, it is the path to a movie clip in your Flash document. The example on the page might answer it for you, since it appears to be the way you go about the target for the function's parameter.
I'm not very experienced in Flash, since I only know the dead basics and haven't really delved into Actionscript for this sort of functionality, so you might have to ask someone who's more experienced in Flash in regards to that question. I'll try to create a mock up of what you're wanting tomorrow, and if I manage to get it working, I'll pass on my working examples to you so you can look at it and hopefully you can learn some things from it in turn. Of course, this is not to say that I may be busy and won't be able to do it for some time, but I wil ltry my best to get it done.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
