Page 1 of 1

Flash Contact Form

Posted: Fri Apr 14, 2006 10:24 pm
by BMN
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


I am trying to make a flash page with a simple form in it. 
It would have a field for Subject, Message, and your email.
It seems to run ok in flash (no errors), but I am not recieving 
an email when i run it. 

The php page (mail.php3) :

Code: Select all

<?php
mail("myemail.com", $subject, $message, "From: PHPMailer\nReply-To: $from\nX-Mailer: PHP/" . phpversion());
?>
The Flash Actionscripting in the Action Field:

Code: Select all

stop();
function lineAdapt() {
	message_send = message;
	while (msg_count<length(message)) {
		msg_count = msg_count+1;
		if ((substring(message_send, msg_count, 2)) eq "\r") {
			message_send = (substring(message_send, 1, msg_count-2)) add "\n" add (substring(message_send, msg_count+2, (length(message_send))-msg_count+2));
		}
	}
	message = message_send;
	delete msg_count;
	delete message_send;
}

The Flash Actionscripting on the Button : 

on (release) {
	if (subject eq "" or message eq "" or from eq "") {
		stop();
	} else {
		lineAdapt();
		loadVariablesNum("mail.php3", 0, "POST");
		gotoAndStop(2);
	}
}
Any Help would be appreciated.
Thanks,
BMN


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Update

Posted: Sat Apr 15, 2006 3:22 am
by BMN
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


I had a couple variables in there that didnt match.
After fixing that i now get the email, with no subject.
In the email field it says "Thomas Hafner's Portfolio" <hostingcompany'sInfo>
and there is no message in the text area of the email.

Here is the updated code



The php page (mail.php) :

Code: Select all

<?
 
   $to = "godloki666@cs.com";
   $msg = "$messageField\n\n";

  mail($to, $subjectField, $msg, "From: Thomas Hafner's Portfolio\nReply-To: $emailField\n");

?>

The Flash Actionscripting in the Action Field :

Code: Select all

stop();
function lineAdapt() {
	message_send = messageField;
	while (msg_count<length(message)) {
		msg_count = msg_count+1;
		if ((substring(message_send, msg_count, 2)) eq "\r") {
			message_send = (substring(message_send, 1, msg_count-2)) add "\n" add (substring(message_send, msg_count+2, (length(message_send))-msg_count+2));
		}
	}
	message = message_send;
	delete msg_count;
	delete message_send;
}

subjectField.tabIndex  = 1;
messageField.tabIndex  = 2;
emailField.tabIndex  = 3;
The Flash Actionscripting on the Button :

Code: Select all

on (release) {
	if (subjectField eq "" or messageField eq "" or emailField eq "") {
		stop();
	} else {
		lineAdapt();
		loadVariablesNum("mail.php", 0, "POST");
		gotoAndStop(2);
	}
}
Any Help will be greatly appreciated.
Thanks in advance,
BMN


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]