Skip to main content
November 19, 2007
Question

Attn: David Stiller

  • November 19, 2007
  • 36 replies
  • 5904 views
Keith Glad suggested that I send a link to the form file and have done so but have not heard anything yet regarding such. Just emailed Chris Beech with the url.

http://www.ecowaterpb.com/fla%2c%20php.zip

Stuff I need help on: Thank you page should open and it does not now. The typed information should come to email and it does not only the word undefined next to titles. The title household does not show in the email.

Here is what is showing in email:

water supply: undefined
softener: undefined
bottled water: undefined
comments: undefined
name/business: undefined
street: undefined
city, state, zip: undefined
phone: undefinedemail: undefined

From: <undefined>
Reply-To: undefined
Return-Path: undefined


This topic has been closed for replies.

36 replies

Inspiring
November 21, 2007
Mary Alice,

>I changed the name and household number still does not show
> in email.

Did you try the trace() statement suggestion I made in my previous
reply?


David Stiller
Adobe Community Expert
Dev blog, http://www.quip.net/blog/
"Luck is the residue of good design."


November 21, 2007
No. But tell me where to put it. That might help, I hope so! Does it go in the PHP script?
November 21, 2007
I changed the name and household number still does not show in email. Gosh, I really wanted to complete the website. I wonder if something in the php script is preventing household number and typed information from appearing.

Here is the php script.

<?php

$SendTo .= "art.design@comcast.net";
$subject .= "Analysis Form Reply";

$headers = "From: " . $_POST["name"];
$headers .= "<" . $_POST["email"] . ">\r\n";
$headers .= "Reply-To: " . $_POST["email"] . "\r\n";
$headers .= "Return-Path: " . $_POST["email"];

$message .= "household: " . $_POST["house"]. "\r\n";
$message .= "water supply: " . $_POST["water"]. "\r\n";
$message .= "softener: " . $_POST["soft"]. "\r\n";
$message .= "bottled water: " . $_POST["bottle"]. "\r\n";
$message .= "comments: " . $_POST["comments"]. "\r\n";
$message .= "name/business: " . $_POST["namebus"]. "\r\n";
$message .= "street: " . $_POST["address1"]. "\r\n";
$message .= "city, state, zip: " . $_POST["address2"]. "\r\n";
$message .= "phone: " . $_POST["phone"];
$message .= "email: " . $_POST["email"];

mail($SendTo, $subject, $headers, $message);

header('Location: http://ecowaterpb.com/thanks.html');

?>

Inspiring
November 21, 2007
Mary Alice,

> The analysis form is doing far better than the html form.

Fair enough. :)

> Well, I am going to change the house name. I know it
> sounds silly but I need to see if that will work.

Before you do that, you may as well just throw a quick trace() statement
in there to make sure the object reference is correct. For example ...

my_lv.house = this._parent.form_mc.house_txt.text;
trace(this._parent.form_mc.house_txt.text);
my_lv.water = this._parent.form_mc.water_txt.text;
// etc.

The trace will put the value of the stated expression into the Output
panel. It might even help to precede that a bit with a string literal, in
case the object reference somehow comes back with an empty string:

my_lv.house = this._parent.form_mc.house_txt.text;
trace("value of house: " + this._parent.form_mc.house_txt.text);
my_lv.water = this._parent.form_mc.water_txt.text;
// etc.

If it comes back empty or undefined, you'll know that somehow your
object reference is wonky.


David Stiller
Adobe Community Expert
Dev blog, http://www.quip.net/blog/
"Luck is the residue of good design."


November 21, 2007
The analysis form is doing far better than the html form. Well, I am going to change the house name. I know it sounds silly but I need to see if that will work.
clbeech
Inspiring
November 20, 2007
Say, good work Mary, and you as well David.

I'd mentioned the other day (in one of the posts :) that you should remove the 'concatenator' (the period) from the first $message var in the PHP doc. (ie. the one for 'household') that should 'start' the string.
November 20, 2007
I took the peiod away but that did not help. I think I will add another line for house. A repeat of it might work. However, I wonder why I would need to do that.? Yes, David, I was going to create an html form but that is a bit time consuming.
Here is how the PHP script now looks.
November 20, 2007
I just added another household line and with a period. The first I had removed the period. Still no household appeared in email. This is very strange. Now, how would an HTML form tell us anything? You seem to think it will help, I suppose I will do one up. Time consuming though.
November 20, 2007
I just tested it again and still no household comes in email. Strange.

Also, is there a need for two closed brackets that follow url line? Why not just one closed bracklet there?
Also, I don't understand the need for an extra open bracket after the re ....success line? Why not just one open bracklet there?
I often wondered about those bracklets?
November 20, 2007
I see I have the form_mc as the instance name but not the instance of, that is only named form. Hmmmmmmmmm Change will come soon. Hope it solves all!
November 20, 2007
PROGRESS!!!!!!

When I type in one of the fields of the form, say I am at household and I type 2, all the other fields light up with 2. Whatever I type in whatever field I am at, all things change to what I am presently typing--all the other fields light up. HELP on this!

See what has come in email! and still where is household?:
water supply: 2
softener: 2
bottled water: 2
comments: 2
name/business: 2
street: 2
city, state, zip: 2
phone: 2email: 2

From: <2>
Reply-To: 2
Return-Path: 2
November 20, 2007
Well, I had to remove the 'instance name' from each field. I kept the 'variable.' For example, water_txt was in the instance name area and water_txt was in the variable name area. If I kept the instance names, the field would light up all the other fields with same typed word or numerals.
November 20, 2007

I think this is the reply you are talking about. It was in the MOVIE CLIP post.

Mary Alice,

> Whoops. No variable name for the FORM, only an instance of
> name: FORM. And it does not seem to have an instance name.

First all, I need to clarify a major typo in my last post. I totally
destroyed the object reference I've been trying to explain, so please accept
my apologies, and I hope my current reply will clarify matters.

Because your path contains the expression "form_mc," the instance name
of that movie clip -- the one that's holding all the text fields -- needs to
be form_mc (because that's the name in your path).

Think of this in terms of folders on your hard drive; it's a great
analogy to what's going on here. That button interprets the ActionScript
object reference like this: "From my own point of view (this), I'll look up
one 'folder' to the timeline I'm in (_parent). From there, I'll look look
for an object with the instance name form_mc. That movie clip contains a
number of nested objects, one of whose instance names is household_txt.
That nested object is a text field, which means it has a text property.
That's what I want." So, string those all together and you get:

this._parent.form_mc.household_txt.text;

That's the location of one of the text fields from the point of view of
the ActionScript associated with your button. In my last reply -- I'll
blame it on a lack of coffee today (lame excuse!) -- I put that object
reference (that "folder path," if you will) in the wrong place.

Consider what you're after, though, it it should make sense. Since the
ActionScript is associated with the button, everything must be taken from
the button's point of view. The LoadVars instance is created inside the
button, so from the button's point of view, the LoadVars instance (my_lv) is
right there.

e.g.
on (release) {
my_lv = new LoadVars();
re_lv = new LoadVars();

So far, so good. If you want to refer to my_lv or re_lv again while
inside this on() handler, no object path is necessary. If you wanted to,
you could use this.my_lv or this.re_lv, but even without the "this," the
path to these objects is understood: they're right here. So, as you create
new properties for the my_lv object, you name the object and its new
property ...

my_lv.household =

... and set that new property equal to the value of the TextField.text
property of one of your text fields in the path we just covered; namely,
this._parent.form_mc.household_txt.text. So ...

my_lv.household = this._parent.form_mc.household_txt.text;

... and so on, with the rest of them:

my_lv.water = this._parent.form_mc.water_txt.text;
my_lv.soft = this._parent.form_mc.soft_txt.text;
// etc.

Does that clear it up?

Note: even after you update all of this, you may still run into
problems, so keep your chin up. There's a lot going on here, and you'll
need to work through each concept until you get it. The concept we're
working toward right now is object references.

> Or, is instance of the same as instance name?

The term instance refers to an object made from a template. If you use
the drawing tools to create some artwork and convert that artwork into a
movie clip, a new movie clip symbol will appear in your Library panel. You
can drag as many copies of that movie clip symbol to the Stage as you like.
Doing so means you're creating that many "instances of" the MovieClip class;
in particular, "instances of" a very specific movie clip in your Library.
Every dynamic or input text field you create, even if it isn't symbol, is
automatically an "instance of" the TextField class. Even if you don't give
them instance names, they're still instances of the classes (the type of
object) they represent. But without instance names, it's much hard to get
ActionScript to speak directly to any of them.


David Stiller
Adobe Community Expert
Dev blog, http://www.quip.net/blog/
"Luck is the residue of good design."
Inspiring
November 20, 2007
Mary Alice,

> You guys know more than me about Actionscript and
> PHP. Let's solve in asap.

We're trying. ;) Sincerely.

> I repaired some of the scripting and now the Thank you
> page appears!

Yay!

> but still nothing in email other than defined. I really need
> to solve this!

Check the other thread, entitled "MOVIE CLIP," where I clarified a typo
in my previous reply to you on that thread (again, apologies). It sounds
like you're almost out of the woods.


David Stiller
Adobe Community Expert
Dev blog, http://www.quip.net/blog/
"Luck is the residue of good design."


November 20, 2007
...through the woods I go...very cutesy. I began the web project sometime in August and was through with everything except the form. Ah the form! Form situation began early October. You guys know more than me about Actionscript and PHP. Let's solve in asap.

I repaired some of the scripting and now the Thank you page appears! but still nothing in email other than defined. I really need to solve this!

I am not sure if that script is in the url:


See the revised scripting.

FORM script:

onClipEvent(data) {
_root.nextFrame();
}
-------------------------------------
SUBMIT script:

on (release) {
this._parent.form_mc.my_lv = new LoadVars();
re_lv = new LoadVars();

this._parent.form_mc.my_lv.household = household_txt.text;
this._parent.form_mc.my_lv.water = water_txt.text;
this._parent.form_mc.my_lv.soft = soft_txt.text;
this._parent.form_mc.my_lv.bottle = bottle_txt.text;
this._parent.form_mc.my_lv.comments = comments_txt.text;
this._parent.form_mc.my_lv.namebus = namebus_txt.text;
this._parent.form_mc.my_lv.address1 = address1_txt.text;
this._parent.form_mc.my_lv.address2 = address2_txt.text;
this._parent.form_mc.my_lv.phone = phone_txt.text;
this._parent.form_mc.my_lv.email = email_txt.text;
re_lv.onLoad = function(success) {
{
getURL(" http://www.ecowaterpb.com/thanks.html");
}
}
this._parent.form_mc.my_lv.sendAndLoad("analysisformphp.php", re_lv, "POST");


CHANGED NOTHING IN PHP:

<?php

$SendTo .= "art.design@comcast.net";
$subject .= "My Analysis Form Reply";

$headers = "From: " . $_POST["name"];
$headers .= "<" . $_POST["email"] . ">\r\n";
$headers .= "Reply-To: " . $_POST["email"] . "\r\n";
$headers .= "Return-Path: " . $_POST["email"];

$message .= "household: " . $_POST["household"]. "\r\n";
$message .= "water supply: " . $_POST["water"]. "\r\n";
$message .= "softener: " . $_POST["soft"]. "\r\n";
$message .= "bottled water: " . $_POST["bottle"]. "\r\n";
$message .= "comments: " . $_POST["comments"]. "\r\n";
$message .= "name/business: " . $_POST["namebus"]. "\r\n";
$message .= "street: " . $_POST["address1"]. "\r\n";
$message .= "city, state, zip: " . $_POST["address2"]. "\r\n";
$message .= "phone: " . $_POST["phone"];
$message .= "email: " . $_POST["email"];

mail($SendTo, $subject, $headers, $message);

header('Location: http://ecowaterpb.com/thanks.html');

?>