Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Send a form from swf 1

Status
Not open for further replies.

247138

Programmer
Jul 3, 2005
32
RO
I need to send my contact form wich consists on 6 separate boxes with input text. I also have the 2 buttons: reset & submit I used the script provided by CMD 83 for purexenon [on key frame 1:
(depending on mailform you're using)
(on a keyframe)
USER = "your@email.com";
SUBJECT = "subject of the mail";
LINK = "stop();

here you also make the form with var: varname
(so this appears in your mailbox)

on the submit button:

go to and play frame 2
here on a keyframe:
getURL(" "_blank", "POST");
stop();

put a thank you or sending... on this frame if you like

the person will get a pop-up with whatever you put on
(this is the mailform from my provider, adjust if you have your own)] {here it's the entire messege, but i used it like he said}
but it doesn't work. on clicking "submit" another page opens [in my browser] with this adress:


and the messege:

tlx_EmailTo Must Be A Valid Email Address

What did I do wrong?
PLS HEEEELP !!!!!
I'm a donkey on the edge!!!!!!

:))))
 
hmm
is the button inside the form MC (with all the textboxes)?
 
yes it is.
But: [and i told u i'm not an expert] it doesn't have any behavior. Does it get it's behavior from the script of th first frame?
If so, why doesn' it send me to the next [or the third] frame? couse, when i hit submit, NOTHING happens.
try it your self, pls:
go on contact, and then the button from the right: TRIMITE
Hope will get through with it in the end.
 
yea i see it doesnt do anything

your submit button gets behavior from this:
Code:
submit_btn.onRelease = function() {
...
}

so i do not think thats the problem, but lets test

find this code:
Code:
//actions for submit button
submit_btn.onRelease = function() {
    //import variables from each input box
    [highlight]sender_mail = email_txt.text;[/highlight]

insert a line below the highlighted part with this code

Code:
trace(sender_mail)

now press Ctrl+Enter and you will enter test mode

enter information into the textboxes and click submit

a window should pop up with something; it should look like this:

pic48ey.gif


if it doesnt pop up then theres a problem
 
OK. I uploaded it. It still doesn't send anything.
it still doesn't get to the next [or third frame].
:(
 
well the submit_btn behaviors should be working

try a different trace action:

find this line:

Code:
    //load variables to the php file
    [highlight]loadVariables("sendmail.php", this, "POST");[/highlight]
    //check to see if everything went A-OK
    onData = function () {

and add this trace action underneath the highlghted line

Code:
trace(sender_message)

and tell me what the popup message says (paste it here)
 
1
User submitted message: <br> Name: 1<br> Email: 1<br> Company: 1<br> Address: 1<br> Tel/Fax=: 1<br> Message=: 1

this is the message inthe pop up. Still not working.
 
ok
did you label the keyframes "error" and "success" like this:
pic57yx.gif



and are both of these keyframes in the form MC (the same MC as the textboxes)?
 
OK
I got the e-mail in my mailbox. Didn't move to the next frame though. WHYYYY. I'm half on the breaking point ;)
Anyway, if u lost your patience, let's leave it 4 now [I can go on, no preoblem]. The form is working, sooo.
One more thing:

Subject: Contact: sdfg
From: "sdfg" <poiupo@server2.hostws.com> Add to Address Book
Date: Thu, 07 Jul 2005 02:34:32 +0300

User submitted message: <br> Name: sdfg<br> Email: poiupo<br> Company:
oipupoi<br> Address: iupoi<br> Tel/Fax=: upoiupo<br> Message=: iu

---------------------------
Mail sent by: sdfg <poiupo>


This is exactly how the message looks like in may yahoo mailbox. is it normal?

THANK YOU A LOT !!!! You're my saviour !!!
 
Well, you can't know how happy i am right now :)

But unfortunately, i dont know how to make the message look better

See those <br>'s? those are supposed to be line breaks. If you turn on Rich Text Editor or something you might be able to see it like its supposed to:

Subject: Contact: sdfg
From: "sdfg" <poiupo@server2.hostws.com> Add to Address Book
Date: Thu, 07 Jul 2005 02:34:32 +0300

User submitted message:
Name: sdfg
Email: poiupo
Company: oipupoi
Address: iupoi
Tel/Fax=: upoiupo
Message=: iu

---------------------------
Mail sent by: sdfg <poiupo>

Well after 50 posts im glad we got it right somewhere!
 
but just in case, check to see if you labeled the keyframe right (like i posted above) and see if it gets fixed
 
well, 4 me it's good night. I don't know where you're from, but in Romania it's 3 o'clock. AM. I'm up since 5AM, so I worked 22 hours streight. So I have to get some sleep too. I'll get back to you with other things [this is a fact :)], but some other time. Note that the subject will be: FOR benny2168. So u won't miss it.
THANK U again.
[Ovidiu]
 
//check to see if everything went A-OK
onData = function () {
nextFrame();
if (output == 'error') {
gotoAndStop("error");
} else {
gotoAndStop("success");
}
};

I think there's something wrong here.
labels are:"error" and "succes". so it should work. But it doesn't. :(
 
what other action script should i use for it to worK. Any ideea?
 
i mean it doesn't even work if i erase the labels and put in script the numbers of the frames.
 
one little issue:
can this [the response, positive or negative] come directly from the php server? I mean, coul te php file be modified in such ways, as to do that?
It's just an ideea. If it can be done, we'll do it like that. [probabely this will meean erasing th next 2 frames]
 
I took this ideea from somewhere else. i know it' bitchy, but i'll post here the part of text that got my atention:

[This is the server side script :
<?php
$sendTo = "postmaster@blahblahblah.com";
$subject = "Website Inquiry";
$headers = "From: " . $_POST["name"];
$headers .= "<" . $_POST["email"] .">\r\n";
$headers .= "Reply-To: " . $_POST["email"];
$message = $_POST["message"];
mail($sendTo, $subject, $message, $headers);
echo "Thank you for your submission. We will reply to your email as soon as possible";
?> ]

Of course, there was a reply:

[PHP Code:
$retMessage="&confirm=Thank you for your submission. We will reply to your email as soon as possible";
print($retMessage); ]

So, i hope u got it.
Thanks
 
Well
the php file alredy has an echo function that looks similar:
Code:
    if(@mail($to, $subject, $body, $header))    {
         echo "output=sent";
    } else {
        echo "output=error";
    }
And im sure theres a way to show this in a new window, but I dont know enough php to say how.

Are both your error and success keyframes within your form MC (the same movie clip as the textboxes)?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top