all groups > flash actionscript > september 2004 >
You're in the

flash actionscript

group:

Ok i have tried everything, someone please help


Ok i have tried everything, someone please help zrocker2004
9/23/2004 9:35:48 PM
flash actionscript:
I have looked at everyones idea's on how to fix the problem i have having with
an email being sent out to a php script.

For some reason it is not capturing the vars from the fields and sending them
to the script. Also i dont want for the page to be called up and shown in the
browser. I tryed in the send function to say "email.php", dataSender, "POST"
and also "email.php", 0, "POST" but what happens is that the PHP script is not
getting the data at all with that even though its not calling it in the
browser. can someone take a look at my FLA file and see what i am doing wrong
so i can study what you are saying?

Here is my script i have now.......

My field VARS are named as follow name, companyName, webAddress, email and
comments

function sendForm () {
my_lv = new LoadVars ();
my_lv.name = _parent.name.text;
my_lv.companyName = _parent.companyName.text;
my_lv.webAddress = _parent.webAddress.text;
my_lv.phone = _parent.phone.text;
my_lv.email = _parent.email.text;
my_lv.comments = _parent.comments.text;

my_lv.send ("email.php", 0, "POST");
}

submit_btn.onRelease = function () {
if (name.text == "" || email.text == "") {
alert_txt.text = "Please complete the entire form ...";
}
else {
_root.gotoAndStop(55);
alert_txt = "";
sendForm ();
}
};

Re: Ok i have tried everything, someone please he _jrh_
9/23/2004 10:21:05 PM
Re: Ok i have tried everything, someone please he zrocker2004
9/24/2004 12:55:38 AM
Ok i changed what you asked for me to do. And still i am getting the same
responsed. Which is no VARS are being passed through to the PHP script.....

Now if you know PHP somewhat this is what i am saying on that side..

<?php

$to = "office@patter****esign.com";
$subject = "Company E-Form";
$name = $_POST['name'];
$companyName = $_POST['companyName'];
$phone = $_POST['phone'];
$webAddress = $_POST['webAddress'];
$comments = $_POST['comments'];
$email = $_POST['email'];

mail($to, $subject, "<html><body><p>$name has just sent you an
email.</p>","<p>Name:$name</p><p>Company:$companyName</p><p>Phone
Number:$phone</p><p>Web
Address:$webAddress</p><p>&nbsp;</p><p>&nbsp;</p><p>Comments:$comments</p><p>&nb
sp;</p><p>&nbsp;</p><p>From:
$to</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>This email service was brought
to you by <a href='patterso*******gn.com'>Patterson
Enterprise</a></html></body>");


?>


Is there a way i can send you the .fla of the file??
Re: Ok i have tried everything, someone please he _jrh_
9/24/2004 1:08:06 AM
Unfortunately, I don't know PHP so I can't help you there. I would suggest
using sendAndLoad() (reference
http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/a
ctionscript_dictionary435.html). That way, you can use flash to see if you get
a response. Try echoing back the same vars and tracing them in flash.

I just saw those errors which is why I spoke up. Sorry I can't be of anymore
help. Hope you solve your problem.
Re: Ok i have tried everything, someone please he kglad
9/24/2004 1:14:27 AM
just for fun try:

submit_btn.onRelease = function () {
if (name.text == "" || email.text == "") {
alert_txt.text = "Please complete the entire form ...";
}
else {
sendForm (); // <-- Note this change!
_root.gotoAndStop(55);
alert_txt = "";
}
};
Re: Ok i have tried everything, someone please he zrocker2004
9/24/2004 1:28:41 AM
ok i have done what you said and still the same thing. And i have an echo for
the alert text to come on if no one fills out the form. So can someone look at
the .fla .... Now its not very big in space.... its only 10.8 KBs
Re: Ok i have tried everything, someone please he kglad
9/24/2004 2:01:10 AM
Re: Ok i have tried everything, someone please he zrocker2004
9/24/2004 2:28:06 AM
Re: Ok i have tried everything, someone please he kglad
9/24/2004 3:12:31 AM
your reference to _parent is incorrect. all those variables are defined on the
same timeline as my_lv. try:

function sendForm() {
my_lv = new LoadVars();
my_lv.name = name; // name is undefined. insert a variable associated with
that input field
my_lv.companyName = companyName;
my_lv.webAddress = webAddress;
my_lv.phone = _phone;
my_lv.email = email;
my_lv.comments =comments;
my_lv.send("email.php", "POST");
}
Re: Ok i have tried everything, someone please he zrocker2004
9/24/2004 3:30:00 AM
Ok changed the script and thanks for your help but still with the same
response. does the .fla from that look ok? and also do you have PHP on your
server to run a script or do you know PHP. but i dont think its from the PHP
side since i have looked into that side already. i was reading on another
tutorial and it said that if you go to a thank you frame out of the actions (
logic ) layer the information would not be sent due to the fact it is out of
the frame for the code before it processed it is that true? if not tell me if
you see something else wrong with the file ( i have made the changes you asked
for already. )
Re: Ok i have tried everything, someone please he kglad
9/24/2004 5:16:00 AM
your fla file should work without problem if you made those corrections. you
can always execute a trace(my_lv.name) etc to make sure your loadVars object
has those variables defined.

what happens in your php file i can't say. i don't use php and so am unable
to help you with that end.
Re: Ok i have tried everything, someone please he zrocker2004
9/24/2004 6:24:53 AM
Re: Ok i have tried everything, someone please he zrocker2004
9/24/2004 6:39:05 AM
ok i think i found what you were talking about. I ran the movie then i went to
debug droped down to list vars... and this is what i got ( as errors ) if this
is what you were not talking about please help on that but here is what it
said...

Level #0:
Variable _level0.$version = "WIN 6,0,21,0"
Variable _level0.sendForm = [function 'sendForm']
Variable _level0.name = "thomas"
Variable _level0.email = "office@pattersonwebdesign.com"
Variable _level0.my_lv = [object #2, class 'LoadVars'] {
name:"thomas",
companyName:"patterson enterprise",
webAddress:"listingnowebsite@none.com",
phone:"555-555-5555",
email:"office@pattersonwebdesign.com",
comments:"hello"
}
Variable _level0.alert_txt =
Variable _level0.companyName = "patterson enterprise"
Variable _level0.phone = "555-555-5555"
Variable _level0.webAddress = "listingnowebsite@none.com"
Variable _level0.comments = "hello"
Re: Ok i have tried everything, someone please he zrocker2004
9/24/2004 8:00:32 AM
Re: Ok i have tried everything, someone please he kglad
9/24/2004 2:06:17 PM
Re: Ok i have tried everything, someone please he zrocker2004
9/24/2004 7:35:27 PM
Yes my PHP file is being called and it is sending out the email but it is not
caturing the VARS when i get the email it does not have any of the data. The
PHP is fine nothing wrong on that end.... but as far as you know the FLA is
perfect?
Re: Ok i have tried everything, someone please he kglad
9/24/2004 9:47:07 PM
yes, the fla with the changes isn't the problem. are you sure you want single quotes in your php file:

$name = $_POST['name'];

shouldn't that be:

$name = $_POST[name];

Re: Ok i have tried everything, someone please he zrocker2004
9/24/2004 11:42:46 PM
Well see it needs some type of quote cause just like the first VAR in the php
script.. it has to be captured..

such as $to = "patterson*****ign.com";
same as $to = $_POST['website']; or $_POST["website"];

that is how it captures it.......
Re: Ok i have tried everything, someone please he zrocker2004
9/24/2004 11:57:39 PM
AddThis Social Bookmark Button