Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Flash php contact form email results

Posted on 2009-12-19
9
Medium Priority
?
308 Views
Last Modified: 2013-11-11
Thanks to Experts Exchange moagrius (guru) I have gotten this far with my flash template php contact form .  It works in that I do get an email from sumitting the form. I get a successfully sent message.  But the email contents do not contain the info ithat was entered n the text fields. The content I get in the email looks like this:

reset_txt   [type Function]
rec   [the email address i put in the ActionScript is repeated here]
serv   php
fields_descriptions   ,t1,your_name,Your Name:,t2,your_email,Your Email:,t3,telephone,Telephone:,t4,message,Message:,t5,field_2,E-mail:,t6,field_3,Address:,t7,field_4,fax:
path   _level0.instance1626

The ActionScript on the submit button is herein code snippet:
Thanks any help!

rec="blissett@cox.net";
serv="php";

var fields_descriptions= Array ("", 
									Array("t1", "your_name", "Your Name:"), 
									Array("t2", "your_email", "Your Email:"),
									Array("t3", "telephone", "Telephone:"),
									Array("t4", "message", "Message:"),
									Array("t5", "field_2", "E-mail:"),
									Array("t6", "field_3", "Address:"),
									Array("t7", "field_4", "fax:")
								);

function reset_txt(name,name2,value) {
		path=eval(_target);
		path[name2]="";
}
	


for (i=1; i<=fields_descriptions.length; i++) {
	reset_txt("t"+i, fields_descriptions[i][1], fields_descriptions[i][2]);
}

Open in new window

0
Comment
Question by:vigilence
  • 5
  • 4
9 Comments
 
LVL 19

Expert Comment

by:moagrius
ID: 26090285
the AS in the FLA is crazy - I'd rewrite the contact form part.  Post the PHP mailer and I'll try to make something that works.
0
 

Author Comment

by:vigilence
ID: 26090707
Thanks.....what is the PHP mailer? :)
0
 
LVL 19

Expert Comment

by:moagrius
ID: 26090748
there's a PHP script that sends the mail form - it's named "contact.php" - post the contents
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:vigilence
ID: 26092305
Yikes..yes...code snippet attached.  Thanks.:)
<?php

Error_Reporting(E_ALL & ~E_NOTICE);
$subject="from ".$_REQUEST['Your_Name:'] ;
$headers= "From: ".$_REQUEST['Your_Email:'] ."\n";
 $headers.='Content-type: text/html; charset=iso-8859-1';
 $message='';
  while ($field = current($_REQUEST)) {
  	if ((key($_REQUEST)!="Your_Name:") && (key($_REQUEST)!="Your_Email:") && (key($_REQUEST)!="Message:") && (key($_REQUEST)!="i")) {
	 	$message.="<strong>".key($_REQUEST)."</strong>&nbsp;&nbsp;&nbsp;".$field."<br>";
	}
	next($_REQUEST);
 }
$message.="<br>".$_REQUEST['Message:'];
mail($_REQUEST['recipient'], $subject,  "
<html>
<head>
 <title>Contact letter</title>
</head>
<body>
<br>
  ".$message."
</body>
</html>" , $headers);
echo ("Your message was successfully sent!");

?>
<script>
	resizeTo(300, 300);

</script>

Open in new window

0
 
LVL 19

Expert Comment

by:moagrius
ID: 26099847
this is going to take a little bit and i'm out all day tomorrow - i'll try to get to it tonight, but it might be wednesday...  :/
0
 

Author Comment

by:vigilence
ID: 26105027
take your time moaqrius....i can't thank you enough!
0
 
LVL 19

Assisted Solution

by:moagrius
moagrius earned 2000 total points
ID: 26108558
OK - had to make some pretty major changes, and since you have MX (right?) and I can publish for MX, I'll have to give instructions.

The PHP form is looking for a few key variables, named:

"Your_Name:" - which I assume is the sender's name, not yours
"Your_Email:" - again I assumed it was the sender's name
"recipient" - who the mail's going to - which I thing is supposed to be the one listed at cox.net

So - if that's correct - do this:

First - click the submit button and remove all the code attached to it - the on(rollover), on(release), everything - just delete it all

Second - go into the symbol of the submit button - it's called roll_view1 copy 3 - and delete the code from LAYER 1, Frame 1 (it looks like the code you posted) - delete all that

Third - go back to the main timeline, and click that instance of the submit button again - now give it an instance name of "submitButton"

Fourth - on frame 179 of the main timeline, on the layer called SCRIPT, remove the code there (again, it looks like the code you posted)

Fifth - in that same frame (179), paste the snippet below.

That should do it.

If you run into more problems, get a copy of Flash 8 somehow and I'll upload the FLA.
var textFields = [{label:"Name", textField:t1}, {label:"Company", textField:t2}, {label:"Telephone", textField:t3}, {label:"Email", textField:t4}, {label:"Message", textField:t5}];

function resetText() {
	for (var i = 0; i<textFields.length; i++) {
		textFields[i].textField.text = "";
	}
}

submitButton.onRollOver = function() {
	submitButton.gotoAndPlay("s1");
};
submitButton.onRollOut = function() {
	submitButton.gotoAndPlay("s2");
};
submitButton.onPress = function() {
	var recipient = "blissett@cox.net";
	var messageParts = [];
	for (var i = 0; i<textFields.length; i++) {
		var textObject = textFields[i];
		messageParts[i] = textObject.label+"="+textObject.textField.text;
	}
	var message = messageParts.join("&");

	var query = "contact.php?recipient="+recipient+"&Your_Name:="+t1.text+"&Your_Email:="+t4.text+"&"+message;
	trace(query);
	getURL(query, "_blank");
	
	resetText();
	
};

Open in new window

0
 

Accepted Solution

by:
vigilence earned 0 total points
ID: 26114009
Yipee!!!!!  Hoorah!!!!!  THANK YOU moaquris!!!!  Cant thank you enough for staying with me on this.  I'm never going to venture near a Flash template again!!!! Whew!  
0
 
LVL 19

Expert Comment

by:moagrius
ID: 26114014
ha!  np - glad it's working for you
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question