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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Emailing a Flash form w/ PHP

Status
Not open for further replies.

jasek78

Programmer
Nov 5, 2001
298
US
I have a flash form and a PHP sendmail script. I used a script from a source that I thought was reputable, but it doesn't work. It was strange in that it worked 'once' then nothing else. Can anyone see anything that I might have done wrong in these scripts?

Any help is appreciated!

Jason Kofoed
jasonkofoed@sbcglobal.net

Flash Form: (send button script)
the text input fields var properties are named:
'email', 'name' and 'message'

on (release) {
data.email = email;
data.name = name;
data.message = message;
data.loadVariables('sendmail.php', 'POST');
_parent.status = 'sending now ...';
}


PHP: "sendmail.php"

<?php

// and import them into the script
$name = $_POST[name];
$email = $_POST[mail];
$message = $_POST[message];


// where to send it
// ***** fixed recipient ******
$recip = "jasonkofoed@sbcglobal.net";
//**** end fixed recipient *******

// build up message
// this code for any multiline text fields
$message = str_replace("\r", "\n", $message);

// info vars
$sender = $_SERVER[REMOTE_ADDR];
// you can rearrange this - just do not add or remove quotes
$mailbody = "Contact form sent by
Name: $name
Email: $email

message:
$message
-------
sender's ip: $sender";

// send it off

mail($recip, "contact form", $mailbody, "From: webserver@esolutionsonline.com");

// and tell visitor
print "&status=mail sent - we will be in touch with you shortly&";
?>
 
oops I mistyped in here... I fixed the 'email' variables. they are the same in both bits of code... still no email showing up in the email, however.

Jason
 
I am using the 'mail' command in PHP. I managed to figure it out so that it works now. For some reason the flash sent the variables differently when it was viewed as the .swf file and when it was embedded into a webpage. Anyone know enough to explain why this is happening?

Jason
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top