PDA

View Full Version : flash mx php mailform



Nickos
February 28th, 2003, 09:38 AM
Hi there

I'm need a bit of help with a php form, I'm already trying to solve it myself for quite a few days now but know results.
Hope some one can help me with this.

here's the script:

<?php
mail("my@email.here", $naam, $adres, $postcode, $plaats, "From: PHPMailer\nReply-To: $from\nX-Mailer: PHP/" . phpversion());
?>

in the flash mx movie i got 5 variables with the names; naam, adres, postcode, plaats, from

on my first keyframe i've got some actions:

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;
}

And on the send button the actions are:

on (release) {
if (naam eq "" or adres eq "" or postcode eq "" or plaats eq"" or from eq"") {
stop();
} else {
lineAdapt();
loadVariablesNum("mailing.php3", 0, "POST");
gotoAndStop(2);
}
}

CyanBlue
February 28th, 2003, 10:10 AM
Howdy...

Just correcting syntax errors for the code...
function lineAdapt()
{
message_send = message;
while (msg_count == msg_count + 1)
{
if ((substring(message_send, msg_count, 2)) == "\r")
{
message_send = (substring(message_send, 1, msg_count - 2)) + "\n" + (substring(message_send, msg_count + 2, (length(message_send)) - msg_count + 2));
}
}
message = message_send;
delete msg_count;
delete message_send;
}
on (release)
{
if ((naam == "") || (adres == "") || (postcode == "") || (plaats == "") || (from == ""))
{
stop();
}
else
{
lineAdapt();
loadVariablesNum("mailing.php3", 0, "POST");
gotoAndStop(2);
}
}Please use code formatting (http://www.kirupaforum.com/misc.php?action=bbcode#buttons) next time you post your code...