Skip to main content
September 27, 2008
Question

Flash form not sending back data

  • September 27, 2008
  • 16 replies
  • 888 views
Hi all I am having problems with a Flash site I am working on where the send button works the contact.php form but when the email comes in it has no content in the fields??

button code
on (release) {
_parent.getURL("contact.php","_blank","GET");
_parent.name="Your Name :";
_parent.email="Your Email :";
_parent.message="Your Message :";
}

php code
<?php
$your_name = $_GET['name'];
$your_email = $_GET['email'];
$your_message = $_GET['message'];

$recipient_email = "derek@house-builder.net";

$subject = "from " .$your_email;
$headers = "From:" .$your_name . "<" . $your_email . ">\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1';

$content = "<html><head><title>Contact Letter</title></head><body><br>";
$content .="Name: <b>" . $your_name . "</b><br>";
$content .="Email: <b>" . $your_email . "</b><br><hr><br>";
$content .= $your_message;
$content .= "<br></body></html>";

mail($recipient_email,$subject,$content,$headers);

?>
<html>
<body bgcolor="#996600">
<div align="center" style="margin-top::60px;color:#FFFFFF;font-size:12px;font-family:"Times New Roman", Times, serif;font-weight:bold">
your message was sent. thank you.
</div>
</body>
</html>
<script>resizeTo(300, 300)</script>

email outcome
Name: Your Name :
Email: Your Email :

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

Your Message :

So you see it is sending the php but not attaching the content
the site is www.kitchen-fitted.co.uk
thank you in advance
best wishes Derek
This topic has been closed for replies.

16 replies

kglad
Community Expert
Community Expert
October 20, 2008
go to the timeline that contains your textfields. recheck each of their instance names and make sure there is no variable associated with the textfields.

if the textfield instance names are name, email and message, what does the following reveal when placed on the timeline that contains your textfields:

trace(this+" "+name);
trace(this+" "+email);
trace(this+" "+message);
October 20, 2008
these are the results for all three, they are the same:-
CODE
undefined
undefined
Error opening URL 'file:///Z|/web%20sites/kitchen/contact.php?message=%5Flevel0%2Einstance267%2Emessage&name=%5Flevel0%2Einstance267%2Ename&email=%5Flevel0%2Einstance267%2Eemail'
/CODE
Any idea??

thanks Derek
kglad
Community Expert
Community Expert
October 19, 2008
try applying the trace() function to the text property of those three objects:

_level0.instance263.name
_level0.instance263.email
_level0.instance263.message

October 19, 2008
below is the results for trace(name) etc
CODE
_level0.instance263.name
_level0.instance263.email
_level0.instance263.message
END CODE

and below is the results for
CODE
trace(sendLV)
message=%5Flevel0%2Einstance254%2Emessage&name=%5Flevel0%2Einstance254%2Ename&email=%5Flevel0%2Einstance254%2Eemail
so the script now looks like this
END CODE

CODE
sendLV = new LoadVars();
receiveLV = new LoadVars();
receiveLV.onData = function(src) {
trace(src);
};

send_btn.onRelease = function() {
sendLV.email = email;// actually now i see you aren't assigning anything meaningful in your code
sendLV.name = name;
sendLV.message = message;

sendLV.sendAndLoad("contact.php",receiveLV,"GET");
};
END CODE
October 19, 2008
Hi I managed to get a trace on the name instance as follows
_level0.instance257.name
undefined
that is the same output it is sending via the php to the email i receive!

ok how do i find the path for the send_btn ?
i assume that is what is messing this all up?
best wishes Derek
kglad
Community Expert
Community Expert
October 18, 2008
have instance names=variable names causes the problem in your previous post.

you need to find the correct path/name to your textfields. so, in your send_btn.onRelease method, use trace(name), for example. if that's undefined and you're certain you have a textfield with instance name = "name", you need to find the path to your textfield.
October 18, 2008
Hi I took out the variable names in the properties pannel and just left the instance names they are:-
name
email
message
I did this because you never mentioned them! did I do right?
the error is that the form does not clear when pressed infact the user does not know if the form has gone at all??

thank you Derek
October 15, 2008
I tested as above and got a trace i uploaded and got an email back, although the button accted quite weired the email as follows

Name: _level0.instance256.name
Email: _level0.instance256.email

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

_level0.instance256.message

not sure what is going on here i published in flash 6 player as anything else i get errors
thanks Derek Moore
kglad
Community Expert
Community Expert
October 15, 2008
are you using variable and instance names for your textfields? and if so, are they the same?

and what error messages are you seeing?
October 15, 2008
like this do you mean?
code
send_btn.onRelease=function(){
trace("i am pressed");
and when i ctrl enter i should be able to get the trace "i am pressed"
kglad
Community Expert
Community Expert
October 15, 2008
use the trace() function to ensure email, name and message are defined in your onRelease handler. and use trace(sendLV) in your onRelease to ensure you defined the lv instances on the correct timeline.