Php Email Tutorial
I'm having a few problems with the php tutorial. I've got all the actions in my main timeline and calling them using instances. I have a mc called formset with an instance of formset in which is another mc called form with an instance of form which on the mc has the following code -
onClipEvent(data){
// show welcome screen
_root.formset.nextFrame();
}
I have a submit and back buttons with the following syntax -
formset.submit.submitbutton.onRelease = function(){
this.formset.form.loadVariables("email.php", "POST");
}
formset.back.backbutton.onRelease = function(){
this.formset.prevFrame();
}
I've a feeling I'm calling the timelines wrong with the root handlers etc. Only being doing flash for about 6 months and I can't really figure out exactly what wrong. Can anyone shine a little light on this problem please.
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 01-26-2004, 06:59 AM
View Complete Forum Thread with Replies
Sponsored Links:
Used Php Email Tutorial From Kirupa, Need Email Validate Help
Hi,
I followed Senocular's tuorial to be able to send a form thru email in flash, it worked (which is great, since i also followed about 100 far more complicated ones i found on the web wich did not work!) but i need some help including an email validation element...i think its targetting the correct textfield variables i'm having a problem with, but i took all my efforts out of the attached files and now just have the functioning regular version and am awaiting some help...i have been at this for almost a week!!!
Ive attached a zip of my .fla and the php script.
Many many many thanks in advance,
sleeepy
View Replies !
View Related
Php Email Tutorial
I'm having a few problems with the php tutorial. I've got all the actions in my main timeline and calling them using instances. I have a mc called formset with an instance of formset in which is another mc called form with an instance of form which on the mc has the following code -
onClipEvent(data){
// show welcome screen
_root.formset.nextFrame();
}
I have a submit and back buttons with the following syntax -
formset.submit.submitbutton.onRelease = function(){
this.formset.form.loadVariables("email.php", "POST");
}
formset.back.backbutton.onRelease = function(){
this.formset.prevFrame();
}
I've a feeling I'm calling the timelines wrong with the root handlers etc. Only being doing flash for about 6 months and I can't really figure out exactly what wrong. Can anyone shine a little light on this problem please.
View Replies !
View Related
Help With Email Tutorial
hey guys having realy problems with the email tutorial, wel applying it. Could someone check out my file and see what I've done wrong please?
All the actions are contained in the last frame on the main timeline.
file
Thanks guys
View Replies !
View Related
PHP Email Tutorial Help
Hi,
I have tried to use the Kirupa PHP email tutorial to help me build an email-form. It is working but it does not return a "thanks for your email". I have followed the tuturial step by step.
Could anyone be so kind to help me out? It is much appreciated!
Here is the fla:
emailform.fla
Here is the website:
Portfolio
Thanks...
View Replies !
View Related
Help With Email Tutorial
hey guys having realy problems with the email tutorial, wel applying it. Could someone check out my file and see what I've done wrong please?
All the actions are contained in the last frame on the main timeline.
file
Thanks guys
View Replies !
View Related
Email Tutorial
Hey All,
I am about to pull my hair out!! I am having trouble with the email tutorial. It works fine on its own put as soon as I load it into a holder mc It doesn't work. I am having real problems with the correct path!!! Any hints or direction would be appreciated.
F
Code:
stop();
var senderLoad:LoadVars = new LoadVars();
var receiveLoad:LoadVars = new LoadVars();
sender.onRelease = function() {
senderLoad.Name = Name.text;
senderLoad.Email = Email.text;
senderLoad.Message = Message.text;
senderLoad.sendAndLoad("http://francomichienzi.com/contact_email.php", receiveLoad);
};
receiveLoad.onLoad = function() {
if (this.sentOk) {
_root.gotoAndPlay("success");
} else {
_root.gotoAndPlay("failed");
}
}
This is the original (tweeked a little) code [/code]
View Replies !
View Related
Email Form Tutorial
just finished the Email form tute at kirupa. instructions a bit vague. any tips much appreciated:
http://www.kirupa.com/developer/acti..._php_email.htm
we are told
Quote:
So on the form movieclip we can add the script that checks for that. When the event runs, we can then go to the next frame showing the thank you screen.
onClipEvent(data){ _root.nextFrame();}
trouble is im not sure where to place this code. i tried putting it in the actions layer but that just caused the form to jump from one frame to the other.
naturally this is a form within a .fla, which i will try to include here. thankyou.
(has anyone ever tried this tutorial before ??)
the form i have done is named form. and lies within photo_mc
View Replies !
View Related
Email Check In PHP Tutorial
Dear all, I'm using the php/email tutorial found on this site and it works fine. However, I would like to add a check for a valid (at least containing '@') email address. How do I integrate this into the very simple php script? The script taken of the tutorial is:
PHP Code:
<?php/*************************************************** * PHP 4.1.0+ version of email script. For more * information on the mail() function for PHP, see * http://www.php.net/manual/en/function.mail.php***************************************************/// First, set up some variables to serve you in// getting an email. This includes the email this is// sent to (yours) and what the subject of this email// should be. It's a good idea to choose your own// subject instead of allowing the user to. This will// help prevent spam filters from snatching this email// out from under your nose when something unusual is put.$sendTo = "me@me.com";$subject = "Email from a web visitor";// variables are sent to this PHP page through// the POST method. $_POST is a global associative array// of variables passed through this method. From that, we// can get the values sent to this page from Flash and// assign them to appropriate variables which can be used// in the PHP mail() function.// header information not including sendTo and Subject// these all go in one variable. First, include From:$headers = "From: " . $_POST["firstName"] ." ". $_POST["lastname"] . "<" . $_POST["email"] .">
";// next include a replyto$headers .= "Reply-To: " . $_POST["email"] . "
";// often email servers won't allow emails to be sent to// domains other than their own. The return path here will// often lift that restriction so, for instance, you could send// email to a hotmail account. (hosting provider settings may vary)// technically bounced email is supposed to go to the return-path email$headers .= "Return-path: " . $_POST["email"];// now we can add the content of the message to a body variable$message = $_POST["message"];// once the variables have been defined, they can be included// in the mail function call which will send you an emailmail($sendTo, $subject, $message, $headers);?>
View Replies !
View Related
A Serious Question For The Email From Tutorial
Hello.
In the Email tutorial http://www.kirupa.com/developer/acti..._php_email.htm
we are told
Quote:
So on the form movieclip we can add the script that checks for that. When the event runs, we can then go to the next frame showing the thank you screen.
onClipEvent(data){ _root.nextFrame();}
trouble is im not sure where to place this code. I have put it in the first frame on the actions layer of the form mc. I will try to up load to server to see what happens.
Am i on the right thread here ?
View Replies !
View Related
Email Form Tutorial
I have the form working fine. My issue is when I have the .swf form loaded into another .swf, it will not goto the next frame. I think it is a levels issue, but I am not sure.
Please help.
View Replies !
View Related
Components And Email Form Tutorial?
Hi,
After hours of searching and playing around with various tutorials, Im not having much luck, and am getting quite frustrated.
I have a simple form with a name input field, a dropdown combo box, and a main enquiry box with scrollbar. These are all components (I dont want to use a regular input box, as I want to keep the form looking consistent). Then I want this to email using a php file.
Are there any tutorials that explain how to do EXACTLY these things? All the tutes Ive seen so far seem to have some of these things, but not all.
Thanks
View Replies !
View Related
How Come Flash-php-email Tutorial Does Not Work?
hey guys im new on this forum, its great, theres alot of very usefull data...
i came across a tutorial on setting up a simple mailer form in flash to work with php, http://www.kirupa.com/developer/acti..._php_email.htm
but when i update the php code to my email, and post the swf, html, and the .php file on my hosting (which has php installed), it doesnt work....
can somebody please help????
View Replies !
View Related
Php Email Tutorial Question RE: Php Script
I am trying to add a few more fields to the php email tutorial, but I am not having luck getting the php script to work with the new data - this is how I tried to do my php script:
$sendTo = "auona@yahoo.com";
$subject = $_POST["subject"];
$headers = "From: " . $_POST["name"] ." <" . $_POST["email"] .">
";
$headers .= "Reply-To: " . $_POST["email"] . "
";
$headers .= "Return-path: " . $_POST["email"];
$comments = $_POST["message"];
$company = $_POST["company" ];
$address = $_POST["address"];
$city = $_POST["city"];
$state = $_POST["state"];
$zip = $_POST["zip"];
$phone = $_POST["phone"];
$joblocation = $_POST["joblocation"];
$message = ($comments, $company, $address, $city, $state, $zip, $phone, $joblocation);
mail($sendTo, $subject, $body, $headers);
I tried to change the $message to $body as I saw in another example with no luck.
Might anyone be willing to help?
Thank you.
View Replies !
View Related
Kirupa's Flash/PHP Email Form Tutorial
I was trying out Kirupa's Flash/PHP email form tutorial:
http://www.kirupa.com/developer/acti..._php_email.htm
However.. the tutorial uses input text fields. Ech textfield has a 'var:' in the property inspector where I am supposed to name each field in order to send the input to EMAIL.PHP.
Now I would like to make the same form, but using Flash MX 2004 built-in components instead of the standard input text fields. How do I make it work so that the input in each field is sent to the PHP file? I can't find the 'var' option anywhere in the component inspector nor in the properties.
Any help would be appreciated. I'm a complete newbie at Flash and Actionscript, so please help me out.
View Replies !
View Related
Problem With Send Email Tutorial (message Field)
Hey Lee, hey everyone.
I watched tutorial on sending messages from Flash with a little help of my PHP and tried it at home BUT when I resize the message field, later the text which is pasted there is larger also :shock: , and in tutorial it wasn't a case.
What is wrong?
:?:
Looking forward for your answer, thanks.
ViVe
View Replies !
View Related
[F8 AS2] Email Flash Form W/checkboxes In ScrollPane Example/Tutorial Request
Hi All,
I was wondering if anyone knew of a tutorial or working example involving a email flash form, which uses:
a scrollpane - which houses an indefinite number of checkboxesan input field for emailan input field for name
...and the form uses PHP.
[Brief overview - I have a page that provides a listing of companies. There are several hundred, so I placed them in a scrollpane. Each company has a checkbox next to it. When a user selects a company - they can select more than one - types in there name and email address, the form should send the information associated with the checked boxes to the designated email address.]
I'm able to put all the elements together, and get them working fine. However, I'm stuck at the form level - trying to retrieve the checkbox information, as well as determining which checkboxes are checked. I'm using this as a base example to work from: http://www.kirupa.com/developer/acti..._php_email.htm.
In particular, I'm having a problem calling a variable from the 1st frame of the swf from within the form movieclip, so that I can load that and pass it to email. Just that information alone would be a great help.
Thanks.
- Stephen
View Replies !
View Related
Question About Email Form Tutorial & Adding HTML Page In Flash?
Hello Im posting questions in here again -_-
Anyway, Ive read Jeffery's Email Form tutorial (the one that has CGI, PHP and ASP in it) My hosting service does not support PHP, however it does support CGI and ASP.
So Ive sent an email and asking my server where is the shebang line for perl and also where is SMTPsvg.Mailer(for ASP just in case CGI does not work) and here is their answer:
Q: What is the correct shebang path for perl? is it #!/usr/bin/perl ?
A: If you are asking for the path for perl, it is c:perlperl5.00503.exe
Q: Do you have "SMTPsvg.Mailer"????
No. We use blat to send mail. The path is c:lat182blat.exe
Now Im wondering If the path they told me is going to work?? because it seems like the path is to a local machine ?!?!?
Also How to I add a html page in flash?? NOT LINK but its like adding it inside flash so you'll see the actually HTML page inside the flash movie??
Please help!! Thank you so much
View Replies !
View Related
Question About Email Form Tutorial & Adding HTML Page In Flash?
Please help me...
Ive read Jeffery's Email Form tutorial (the one that has CGI, PHP and ASP in it) My hosting service does not support PHP, however it does support CGI and ASP.
So Ive sent an email and asking my server where is the shebang line for perl and also where is SMTPsvg.Mailer(for ASP just in case CGI does not work) and here is their answer:
Q: What is the correct shebang path for perl? is it #!/usr/bin/perl ?
A: If you are asking for the path for perl, it is c:perlperl5.00503.exe
Q: Do you have "SMTPsvg.Mailer"????
No. We use blat to send mail. The path is c:lat182blat.exe
Now Im wondering If the path they told me is going to work?? because it seems like the path is to a local machine ?!?!?
Also How to I add a html page in flash?? NOT LINK but its like adding it inside flash so you'll see the actually HTML page inside the flash movie??
View Replies !
View Related
[F8] Flash 8 - Email Form: How To Get Users Specified Email In From Portion Of Email
Hey guys,
I want to add a newsletter to my new website that people can add their email addresses to. First off, I would like to have a field that the user can type his email address in, and have that field check if the email is valid (ie make sure that there is an @something.something).
Next, I would like it to send an email to my email address, with their email address in the from portion of the email (basically as if they have emailed me directly from their email). This way, it will be very easy for me to add them to my mailing list.
Thanks a ton for any help... Ive been searching for a while on how to do this, but couldn't find a way to put the users email in the from portion of the email.
View Replies !
View Related
Email Forms That Send Email To Other Email Addresses
hello, well, I'm not sure who to ask about this problem. The thing is I really want to make an email form that can send email to other people. I have seen email feedback forms here that send email to my address but I would really appreciate it if someone could help me make one that sends email to other addresses. I have made an email feedback form already and its at http://www.jeviwebs.com/beatles/mail.swf if you want to view it. If any of you know of any tips, please email me or respond to my post here thanks! BTW, that feedback form was based on matthew summers tutorials here
it is in the send button where I have the problem
here is the action script for the action layer:
recipient = "";
targetpage = "http://www.jeviwebs.com/beatles/ecard.htm";
stop();
this works ok since you will specify the email address of the person to send email to (thus the blank recipient variable) but here is the main problem...the actionscript for the send button....since I want to send emails to other people, I can't use my cgi bin for that.
on (release) {
getURL("http://myaddress.com/cgi-sys/mailform.cgi", "lower", "POST");
}
on (release) {
gotoAndPlay(2);
}
I know that there is a way through this...I can change and do actionscript if someone can help me out...thanks you guys
View Replies !
View Related
Send An Email With The Users Email To An Email Address
ok..the subject may be a little confusing but this is what i have...
an input textbox where viewers type in their email address
a submit button
i want it so that when you hit submit after typing in your email address it sends an email to your@address.com providing you with whatever the person typed in the input textbox
is this possible without using php or asp or whatever?
peace
spen
View Replies !
View Related
A Good Email List Program In Php And Email Form In Flash MX
Hello guys and Girls. Does anyone know how to setup a and direct me to a good 'Email List' program maybe done in PHP where essentially people come to my flash website....click a button to 'subscribe' to my newsletter' and when they do that.....they just type in their email addy and it is sent to a data base or something . I want to be able to simply type up a new newsletter and have it sent to all my email members who are in that email list in that data base?
I dont want anything more complicated than that!
I'm just paln to have a simlpe button in Flash that they click...and a small popup appears with a small form in flash for their email address and their name.
Let me know if anyone can refer me somewhere or help me out!
Thanks...
View Replies !
View Related
How To Email Textbox Attributes To An Email? (Basically A Form)
Hi I have a survey where you need to fill out a few answers, then it will auto email all the answers to one certain email. I'm not sure of the code I would use to email it. Im having a lot of trouble here, basically I would have it send one big string which includes the text variables like
"Name: " + name + "
" + "Age: " + age + "
" + "What Did you Think of the game?: " + feedback
etc. etc.
How would I send that one string to an email? Thanks ahead of time
View Replies !
View Related
HTML Formatted Email W/ Flash: Email Link Help
is there a way to put a mailto into a Flash that's embedded in an email without a browser window popping up when the user clicks on it.
The reply email works fine, but a browser window will open with the mailto in the URL and "Action Canceled" in the window. Not too pro looking.
Also, I found the Flash only plays in some email clients, when user views the email. I had to put a 'play' button on the first frame before the loader in case it doesn't play. I tried putting a "gotoAndPlay" but that didn't work either, took the loader out, even put the animation on the main timeline. Funky.
Told the client it's a bad idea, unpredictable, but they never listen to people that know what's up...
View Replies !
View Related
[MX04] Making An Email Button Go To Email Client
Good Day,
I have made a button on my website and would like it to do the following:
When pressed it would open the users email client and put my email address in the "TO" box so they can send an email to me.
Sounds simple but I can't work out how to make this happen.
Is there a better way to do this?
Can somebody help me with this?
View Replies !
View Related
Email Link On Swf Doesn't Work In Embeded Email, Why?
I am working on a swf file (sort of an ad) for email distribution purpose, the swf has an email link on it for potential clients to reply to us.
I upload the swf on our server, embed the swf into an email, and send the email off to do a test, the animation is playing fine, but there is a problem, when i click on the email link, I receive the following error message:
"Microsoft Outlook has encountered a problem and needs to close. We are sorry for the inconvenience."
And then the Outlook is closed down.
But this problem only happens on NT system, as while i click the same link from my XP, it instantly open up a new reply message fine, anyone has come across this problem and knows how to get around with it, could you help?
Many many thanks
View Replies !
View Related
Flash PHP Email , Hide Formatting In End-user Email?
Hello and thanks for taking the time,
I built a Flash email sender, its very simple, it just sends all the variables in the fields, no cross checks or nothing.
Problem: here's what the end-user email looks like:
Subject: Message from <TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="_sans" SIZE="14" COLOR="#000000" LETTERSPACING="0" KERNING="0">Smiles</FONT></P></TEXTFORMAT>
Name : <TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="_sans" SIZE="14" COLOR="#000000" LETTERSPACING="0" KERNING="0">Smiles</FONT></P></TEXTFORMAT>
Email:
Comments: <TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="_sans" SIZE="14" COLOR="#000000" LETTERSPACING="0" KERNING="0">Massage</FONT></P></TEXTFORMAT>
Here's my PHP code:
<?
$destination="jjmorga@gmail.com";
$name=$_POST['name'];
$subject=$_POST['subject'];
$mes=$_POST['message'];
$subject="Message from $name" ;
$mes="Name : $name
Email: $email
Comments: $mes
";
mail($destination,$subject,$mes); ?>
To anyone that helps me tackle this pickle I bid you a million thanks
View Replies !
View Related
Email Form Sends Out Email 3 Times?
I am using the Web Service Connector to take text input on a form and email it from the website to the intended party. However, it sends the email out three times and I can't find where the error is. When I test the movie I get the following error: "Binding between <unknown>.. and <unknown>.params.emailFrom: The endpoint of the binding does not exist." It shows this error twice. So I am guessing the problem lies with these errors, which would give me three emails total.
Any ideas? I can't find any other instances of the WSC on the site?
Thanks,
Jim
View Replies !
View Related
Email Autoresponder That Includes Recipient's Name In Email
Hi--
I am trying to set up an email autoresponder in Flash MX that includes the recipient's name in the salutation of the email.
For example, if Bob Barker is at my site, I want to give him two boxes to fill in: one for his name (Bob) and the second for his email address. When he clicks the "ok" button, an autoresponder will send him an email that begins with, "Hi, Bob--etc." THEN, once he receives the email, if he answers it, I'd like ANOTHER autoresponse addressed to "Hi, Bob," but this time with a different message.
This must be pretty easy to do, but I have NO idea how. Can anyone direct me to a source on this? Or someone with the know-how?
Many, many thanks!
View Replies !
View Related
Flash Email Form -- No Content In Email
I realize that a similar question has been posted many times, but since I've been searching for an answer that works specifically for me for 2 long days, I feel I need to post.
I've created a guestbook-type form in Flash and a perl script to send the contents of that form to my own email address. Things seem to be working fine except that the email I get is blank. I don't know much about scripting outside of Flash, so I'd appreciate some help. I think my perl script is the problem, but I'm copying both scripts below.
Thanks a milion.
-------------------------------------------------------------------
My SendMail.pl script:
-------------------------------------------------------------------
#!/usr/bin/perl
print "Content-type: text/html
";
$title='New Birdie Guestbook Entry';
$to='jessica@jessicaberardi.com';
$from= 'jessica@jessicaberardi.com';
$subject='New Guestbook Entry';
$name = 'name_txt';
$address = 'address_txt';
$city = 'city_txt';
open(MAIL, "|/usr/sbin/sendmail -t");
## Mail Header
print MAIL "To: $to
";
print MAIL "From: $from
";
print MAIL "Subject: $subject
";
## Mail Body
print MAIL "New Guestbook Entry
";
close(MAIL);
print "<html><head><title>$title<
/title></head>
<body>
";
## START HTML content
print "<h1>$title</h1>
";
print "<p>A message has been sent from $from to $to";
## END HTML CONTENT
print "
</body></html>";
-------------------------------------------------------------------
My Flash code:
-------------------------------------------------------------------
stop();
function sendForm () {
my_lv = new LoadVars ();
my_lv.name = _parent.name_txt.text;
my_lv.address = _parent.address_txt.text;
my_lv.city = _parent.city_txt.text;
my_lv.state = _parent.state_txt.text;
my_lv.zip = _parent.zip_txt.text;
my_lv.phone = _parent.phone_txt.text;
my_lv.email = _parent.email_txt.text;
my_lv.message = _parent.message_txt.text;
my_lv.send ("http://www.jessicaberardi.com/test/SendMail.pl", "POST");
gotoAndStop("thankyou");
}
submit_btn.onRelease = function () {
if (name_txt.text == "" || email_txt.text == "") {
status_txt.text = "Please complete the required fields.";
} else {
status_txt.text = "";
sendForm ();
}
};
View Replies !
View Related
Email Form, Help To Make Email In Html
hi ive made a email form for my site. it works but i want the email that is sent to be in html so i change images and tables.
here is my php script
PHP Code:
<?php
$adminaddress = "gerard@organisedkaos.net";
$siteaddress ="http://www.atr-training.co.uk/";
$sitename = "ATR";
$date = date("m/d/Y H:i:s");
// List and load Flash vars - and convert into PHP vars.
$inputname=$_POST['inputname'];
$address1=$_POST['address1'];
$email=$_POST['email'];
$tele1=$_POST['tele1'];
$selection2=$_POST['selection2'];
$messagebox=$_POST['messagebox'];
if ($REMOTE_ADDR == ""){
$ip = "no ip";
} else {
$ip = getHostByAddr($REMOTE_ADDR);
}
mail($adminaddress,
"Message",
"Name: " . $inputname. "
".
"Address: " . $address1. "
".
"Telephone: " . $tele1. "
".
"email: " . $email. "
".
"how did you find us: " . $selection2. "
".
"------------------------------
".
"message: ". $messagebox. "
".
"
------------------------------
".
"Logged Info :
".
"Using:". $HTTP_USER_AGENT. "
".
"Hostname: ". $ip. "
".
"IP address: ". $REMOTE_ADDR. "
".
"Date/Time: ". $date. "
".
"FROM: ". $adminaddress, "From:". $email);
mail($email, "Auto-response from ATR", "Thankyou for contacting us. We will get back to you shortly. ",
"From: info@atr-training.co.uk".
"Reply-To: info@atr-training.co.uk".
"X-Mailer: PHP/" . phpversion());
?>
please help
gerard
View Replies !
View Related
Help Please Email From Page To Another Email With Url Link
This is getting really confusing for me so I need some help! The issue is that I am developming a video player that a client would like to have an ability of users to send (email) the page to a freind, with a link back to that specific page. I have experience sending mail via PHP scripts, and the mailto: commands. Does anyone have any idea how this could be accomplished? I need some direction. Thanks Devon
www.conjuringzoo.com
View Replies !
View Related
Email Form Not Sending Email... Please Help
Hi all,
I have a flash-based mailer form that was working at one point, but now it won't send email to the specified account for some reason. The host says that it needs to be sent FROM a valid email address on their server, but I can't figure out where in the code I need to make that work...
Here's the code on my submit button:
Code:
on(release){
formValidation();
if(validForm == true){
form.loadVariables("../email.php", "POST");
}
}
Here's the code in my PHP file:
Code:
<?php
$sendTo = "mail@kavehmedia.com";
$subject = $_POST["subjectTxt"];
$headers = "From: " . $_POST["nameTxt"];
$headers .= "<" . $_POST["emailAddressTxt"] . ">
";
$headers .= "Reply-To: " . $_POST["emailAddressTxt"];
$message = $_POST["messageTxt"];
mail($sendTo, $subject, $message, $headers);
?>
What am I doing wrong? Since it was working when I first made it, I assume the host changed something on their end, but they're being very unhelpful...
View Replies !
View Related
Email Form Need To Add Telephone # To Email
Hi,
I am using this email form and it works just fine, but I am trying to figure out how to add additional input feilds that show up in the email body. For example, when you receive the email the body of the email would look like this:
Name:
E-mail:
Telephone:
Feedback:
Below is the AS and the PHP code. Attached is the FLA. Any help would be appreciated
Code:
/*
AUTHOR : Z Syed
CREATING FEEDBACK FORM IN FLASH USING PHP
*/
/*
create the LoadVars objects. One for sending information to the php file and one for recieving information.
Although this can be done with one loadvars object, it makes for cleaner code to use two
*/
var sendData_lv:LoadVars = new LoadVars();
var receiveData_lv:LoadVars = new LoadVars();
var formValidated:Boolean;
var errorMessages:Array = new Array();
receiveData_lv.onLoad = function():Void{
trace(this.sent);
if(this.sent == "OK"){
message0_txt.text = "Thank you for your feedback";
}else{
message0_txt.text = this.sent;
}
}
submit_btn.onRelease = function() {
//this clears the error text field if they have been populate previously
clearTextFields();
errorMessages.length = 0; //empty the array so next time the submit button is clicked the array is not already populated
formValidated = checkForm();
if (formValidated) {
//the form is valid and so now we can send details to our PHP file
//populate LoadVars object with the field values
sendData_lv.name = name_txt.text;
sendData_lv.email = email_txt.text;
sendData_lv.feedback = feedback_txt.text;
//trace(sendData_lv.email);
//trace("valid");
sendData_lv.sendAndLoad("email.php?ck="+new Date().getTime(), receiveData_lv);
} else {
//populate textfields with the error messages
for (var i = 0; i<errorMessages.length; i++) {
_root["message"+i+"_txt"].text = errorMessages[i];
trace(errorMessages[i]);
}
}
};
function checkForm():Boolean {
//check whether the name field is empty
if (name_txt.text == "") {
errorMessages.push("Please enter your name.");
}
if (email_txt.text == "") {
errorMessages.push("Please enter your email address.");
} else if (email_txt.text.indexOf("@") == -1 || email_txt.text.indexOf(".") == -1) {
errorMessages.push("Please enter a valid email address.");
}
if (feedback_txt.text == "") {
errorMessages.push("Please enter some feedback");
}
//if at this point the array is empty i.e has length 0, then this in effect means the form has passed all checks
if (errorMessages.length == 0) {
return true;
} else {
return false;
}
}
function clearTextFields():Void {
for (var i = 0; i<errorMessages.length; i++) {
_root["message"+i+"_txt"].text = "";
;
}
}
}
PHP Code:
<?php$name = $_POST['name'];$email = $_POST['email'];$feedback = $_POST['feedback'];$subject = 'feedback from your website';$headers = "From: $name <$email>
";$headers .= "Reply-To: $name <$email>
";//ENTER YOUR EMAIL ADDRESS HERE$to = 'email@emailaddress.com';//---------------------------$success = mail($to, $subject, $feedback, $headers);if($success){echo '&sent=OK';}else{echo '&sent=Error';}?>
View Replies !
View Related
To The Tutorial Writing Staff: XML Portfolio Tutorial
Hi guys!
I'm a basic actionscript user which knows the basics of xml and actionscript. I've been seaching for a tutorial for a long time now how to make a portfolio which is dynamic and loads info from an external .xml file.
Since i couldn't find any tutorial like this i've tryed to make my own script out from this xml file:
Code:
<portfolio thumburl="thumbs/" imgurl="images/">
<project hdline="my first project" client="none" date="2007-01-02" category="website" weburl="http://website.com">
<image url="image1.jpg"/>
<image url="image2.jpg"/>
<image url="image3.jpg"/>
<description><![CDATA[This describes my first project]]></description>
</project>
</portfolio>
I have hade in mind that you should see a bunch of thumbnails first in a table format (like 6 cols and 3 rows) on each page, then you should be able to select page with next and prev buttons. When you press on a thumnail a box with the bigger image shuld pop-up and you should be able to read the other information in the xml file (such as client, date etc etc).
I've tryed to make this but it's to advanced. And my version is very buggy, aswell.
Here is what i've done sofar:
www.vmgcomputers.com/xml/portfolio3.swf
I don't know if this helps but here is a "multiple loader" i found:
http://www.johnnyslack.com/content/d...der_jslack.zip
I think there are many guys who are looking for a tutorial about this so please consider to make one, all professionals out there!
View Replies !
View Related
XML - Mix The Squirrel Tutorial And The Portofolio Tutorial
Hello,
I'm trying to mix 2 tutorials: the Squirrel Finder (http://www.kirupa.com/web/xml/exampl...rrelfinder.htm )and the Portfolio ( http://www.kirupa.com/web/xml/examples/portfolio.htm ).
Actually i want to create a list of buttons based on loaded xml and when the buttons are cliked i want to displays information obtained from the xml
associated with that button (this part is ok).Now the things is that i also want to add to each "squirrel" a portofolio but i can 't figure out how to write the AS.
here are my codes
the xml
Code:
<?xml version="1.0" ?>
<menu>
<menuitems sourceurl="http://spot.colorado.edu/~halloran/sqrl.html">
<item type="squirrel">
<species>Abert Squirrels</species>
<location>
<![CDATA[Abert squirrels (Sciurus aberti) are only found in mountain regions of North America. In the United States their range extends from extreme south-central Wyoming to New Mexico and Arizona. There are six valid subspecies including S.a. ferreus, True, the subspecies that is found along the Front Range of the Rocky Mountains in Colorado. Abert squirrels are limited to Ponderosa pine (Pinus ponderosa) forests in which they feed and build their nests.]]>
</location>
<portfolio>
<picturetitle= "Tiny Disk"
thumb= "portfolio_images/thumbs/tinydisk.jpg"
description= "portfolio_text/tinydisk.txt"
image= "portfolio_images/tinydisk.jpg" />
<picturetitle= "Plug"
thumb= "portfolio_images/thumbs/plug.jpg"
description= "portfolio_text/plug.txt"
image= "portfolio_images/plug.jpg" />
<picturetitle= "Disk Collection"
thumb= "portfolio_images/thumbs/diskcollection.jpg"
description= "portfolio_text/diskcollection.txt"
image= "portfolio_images/diskcollection.jpg" />
</portfolio>
</item type="squirrel">
<item type="squirrel">
<species>Douglas Squirrels</species>
<location>
<![CDATA[Douglas squirrels (Tamiasciurus douglasii) are found throughout the coniferous forests of Southwestern British Columbia, western Washington, western Oregon, and western California.]]>
</location>
<picturetitle= "Tiny Disk"
thumb= "portfolio_images/thumbs/tinydisk.jpg"
description= "portfolio_text/tinydisk.txt"
image= "portfolio_images/tinydisk.jpg" />
<picturetitle= "Plug"
thumb= "portfolio_images/thumbs/plug.jpg"
description= "portfolio_text/plug.txt"
image= "portfolio_images/plug.jpg" />
</portfolio>
</item>
<item type="squirrel">
<species>Eastern Grey Squirrels</species>
<location>
<![CDATA[Eastern gray squirrels are found throughout the eastern United States; their natural range extends from Florida, north to Canada, and west to where the deciduous forests meet the great plains grasslands. There are 5 subspecies of eastern grey squirrels, S. carolinensis carolinensis is the subspecies found in most of the south from northern Florida, to North Carolina, west to Missouri, and eastern Texas.]]>
</location>
</item>
</menuitems>
</menu>
the as
Code:
function DisplayInfo(){
menu_mc._visible = false;
infobox_mc._visible = true;
infobox_mc.content_txt.text = this.location_text;
}
infobox_mc.close_btn.onRelease = function(){
menu_mc._visible = true;
infobox_mc._visible = false;
infobox_mc.content_txt.text = "";
}
infobox_mc._visible = false; // start the info box hidden
// define basic variables for setting up the menu
var item_spacing = 28; // how far menu items are spaced veritcally
var item_count = 0; // counts menu items as they are added from the XML
// var for the portofolio
var thumb_spacing = 40;
// load variables object to handle loading of text
var description_lv = new LoadVars();
description_lv.onData = function(raw_text){
description_txt.text = raw_text;
}
// CreateMenu creates a menu based on the XML object passed.
// It loops through all the items with a for loop adding clips to the menu_mc
// movieclip on the timeline, defining the appropriate text where needed
function CreateMenu(menu_xml){
// start with the first item in the XML
var items = menu_xml.firstChild.firstChild.childNodes; // menu -> menuitems -> child nodes array
for (var i=0; i<items.length; i++) {
// only continue if the type of this item is a squirrel
if (items[i].attributes.type == "squirrel") {
// create variables for our elements
var species = items[i].firstChild; // same as items[i].childNodes[0]
var location = items[i].childNodes[1]; // second child node
//function GeneratePortfolio(portfolio_xml){
//var portfolioPictures = portfolio_xml.firstChild.childNodes;
//for (var i = 0; i < portfolioPictures.length; i++){
var currentPicture = portfolioPictures[i];
var currentThumb_mc = menu_mc.createEmptyMovieClip("thumbnail_mc"+i,i);
currentThumb_mc._x = i * thumb_spacing;
currentThumb_mc.createEmptyMovieClip("thumb_container",0);
currentThumb_mc.thumb_container.loadMovie(currentPicture.attributes.thumb);
currentThumb_mc.title = currentPicture.attributes.title;
currentThumb_mc.image = currentPicture.attributes.image;
currentThumb_mc.description = currentPicture.attributes.description;
currentThumb_mc.onRollOver = currentThumb_mc.onDragOver = function(){
info_txt.text = this.title;
}
currentThumb_mc.onRollOut = currentThumb_mc.onDragOut = function(){
info_txt.text = "";
}
currentThumb_mc.onRelease = function(){
image_mc.loadMovie(this.image);
description_lv.load(this.description);
}
}
}
// Create a menu item movie clip in the menu_mc instance on the main timeline
// for each item element offsetting each additional further down the screen
var item_mc = menu_mc.attachMovie("menu_item","item"+item_count, item_count);
item_mc._y = item_count * item_spacing;
item_count++;
// assign text using nodeValue to get the text
// from the text nodes and CDATA sections
item_mc.species_txt.text = species.firstChild.nodeValue;
item_mc.main_btn.location_text = location.firstChild.nodeValue;
// set the onRelease of the item button to the DisplayInfo function
item_mc.main_btn.onRelease = DisplayInfo;
}
}
}
var squirrel_xml = new XML();
squirrel_xml.ignoreWhite = true;
squirrel_xml.onLoad = function(success){
if (success) CreateMenu(this);
else trace("Error loading XML file"); // no success? trace error (wont be seen on web)
}
squirrel_xml.load("squirrel_finder.xml");
Thanks for the help
View Replies !
View Related
Email Variables Through Email
I have what might seem like a simple question. However, I can't find the answer. I created a multiple choice test with 5 questions. Each answer is stored as a variable. q1, q2, q3, q4, q5. On the last screen I created a name text field for them to type their name. Now I want to create a submit button that will email me the value of all of the variables separately.
I can't figure out how to format the getURL message to email each variable to me. Here is what I've tried and I get "undefined" in my email body:
on (click) {
getURL("mailto:dsmith@help.com?subject=AEIOUsales" + "&body=" +employee +q1+q2+q3);
}
Please help me with my simple question...Show me an example of how this script should be formatted. Thanks in advance!
View Replies !
View Related
Cgi-bin And Email
could someone help me how to use flash to get our visitors email address by putting a submit button
and about the script for this
thanks
PS: is there any web site for this tutorial
View Replies !
View Related
Email
I think my problem is a little more complex than what i thought it would be. Anyway, I'm trying to set up Flash to do a email to alot of people for comments. Well i got it to work for about 10 addresses, but after that it doesn't like anymore. is there another way i can do this? would a "comments" type page work better? if so how can i get flash to do the background work for it, with out openning email up.
View Replies !
View Related
|