PDA

View Full Version : contact form with userid input instead of email... please help!



lolomedia
March 15th, 2006, 10:41 PM
ok so i have my contact form that it grabs user id and message comments
send it to php and i'll get on my email.

i don't know what seems to be the problem... but i have try it in different ways.

this is what i have on my .as submit button



on (release) {

if (!UserID.length) {
EmailStatus = "Please enter a valid Progress Energy Corporate ID";
}

else if (!ToComments.length) {
EmailStatus = "Please enter your message";
}

else {
loadVariablesNum ("MailPHP.php", "0", "Post");
gotoAndPlay(10);
}
}


and my php says this


<?
$UserID .= "@lolomedia.com";

$ToEmail = "info@lolomedia.com";

$ToSubject = "Training Orientation Feedback";

$EmailBody = "UserID:".UserID."\n\nMessage Sent:\n".$ToComments."\n";

mail($ToName." <".$ToEmail.">",$ToSubject, $EmailBody, "From: ".$UserID." <".$UserID.">");

?>


the reason i have it like that is because i want the user to only enter its userid on the form, example
if my email is lolo@lolomedia.com
then on this form i will only enter lolo
because the rest which is @lolomedia.com will be pick up on the php form.


here are my source files...
http://www.i-mambo.net/EAS/Mail2.fla
http://www.i-mambo.net/EAS/MailPHP.php
http://www.i-mambo.net/EAS/Mail2.swf this is the swf.
please help with this!!

Voccart
March 16th, 2006, 06:05 AM
Hello,

your php script is expecting two values


$UserID
// AND
$ToComments
but they are never sended from flash! so you have to change your AS i think.

in this line you have an error:

$EmailBody = "UserID:".UserID."\n\nMessage Sent:\n".$ToComments."\n";


change it into:

$EmailBody = "UserID:".$UserID."\n\nMessage Sent:\n".$ToComments."\n";


for a good tut about sending mail in flash : http://www.sephiroth.it/tutorials/flashPHP/email/index.php

lolomedia
March 16th, 2006, 12:45 PM
awesome thanks!

i will try that.