PHP Flash Form-Mail Tutorial

*Originally posted by Seretha Blaze *
**
8).Open notepad and enter


<?PHP
$to = "you@yourdomain.com";
$msg = "$name

";
$msg .= "$phone

"; 
$msg .= "$email

"; 
$msg .= "$comment

"; 
mail($to, $subject, $msg, "From: My web site
Reply-To: $email
");
?> 

Replace the email with your own and then add all of the variables you’ve used. When you use multiple

variables you have to use “.=” as shown above in the code. The
is just like a br in html.

It starts a new line. Make sure to have the ; as they show there is more code to come.

9).Now save this file as form.php (You’ll have to type in the extension or it will just save as txt.

10). Go to keyframe 2 and enter whatever confirmation text you want the user to see upon submiting his request.

  1. Upload the .swf and the .php to your server and there you are…a mailing form ready for your

visitors.

Happy Mailing All.

:love: **

this may sound stupid (i know nothing about php!) but where do i put the php code? whats notepad?

thanks

Notepad is the windows notepad program.

<html>
<head><title></title></head>
<body>

<?php
CODE GOES HERE
?>

</body>
</html>

=)

could i just write it in word? (i’m using a mac) and save as .php?

thanks

I prefer Notepad :wink:
And dont forget to save as .PHP

lol, ok thanks!

You’re welcome
=)

thanks, i’ll try it out now

ok, heres my php code

<?php
$to = "cartoonfox@hotmail.com";
$msg = "$name

";
$msg .= "$subject

";
$msg .= "$email

";
$msg .= "$message

";
mail($to, $subject, $msg, "From: My web site
Reply-To: $email
");
?>

and heres the code for when you press send

on (release) {
if (name eq “” or subject eq “” or email eq “” or message eq “”) {
gotoAndStop(3);
} else {
loadVariablesNum(“form.php”, 0, “POST”);
gotoAndStop(2);
}
}

why doesnt it send to my e-mail address?

mail($to, $subject, $msg, "From: My web site
Reply-To:
$email
");
?>

does this have to have my web site addres on it?

loadVariablesNum(“form.php”, 0, “POST”);
should this have the full address for the php file? (http://216.120.237.84/~cartoon/form.php)

can someone help??:-\

does your server support PHP?

here, check this out: http://www.kirupa.com/web/testphp.htm

doesnt look like it does!it came up as ‘‹Ïࡱe’ !! its free so maybe thats why (hostrocket free service)

but…, i also used tripod.lycos.com (i have a free host with them too) and it didnt work there either, but you said that free tripod DOES support php! so it must be something wrong with the php file or the swf file!

or, it could be to do with me not using notepad but using microsoft word. whats ASCII anyway? is word one?

You can use Word. Just make sure you choose “Plain Text” from the drop down, and save your file with the .php extension.

ex:

blah.php

I’m useing a Mac…

I tried three different scripts:

Jubbas’ Worked::
< ?PHP
//(added “PHP” here because it’s a more widely functional syntax)
// Recieving Variables…

$Name = $_POST[‘name’];

$Email = “insert—>MyName@myDomain.com”;

$Message = $_POST[‘message’];

$Subject = “Test E-mail Tutorial”;

$Header = “From: $Name <$Email>”;

//Performing Mail script…

$new = mail($Email, $Subject, $Message, $Header);
?>

Seratha’s didn’t work :frowning: at all (???)

This one is real cool, it has IP logging and a load of error scripts in it for verifying emails and other fields - check it out::

http://www.bigjolt.com/ [click on… “theLab”>“phpMailer”>“dnldZip”]

*Originally posted by RelandR *
**I’m useing a Mac…

I tried three different scripts:

Jubbas’ Worked::
< ?PHP
//(added “PHP” here because it’s a more widely functional syntax)
// Recieving Variables…

$Name = $_POST[‘name’];

$Email = “insert—>MyName@myDomain.com”;

$Message = $_POST[‘message’];

$Subject = “Test E-mail Tutorial”;

$Header = “From: $Name <$Email>”;

//Performing Mail script…

$new = mail($Email, $Subject, $Message, $Header);
?>

Seratha’s didn’t work :frowning: at all (???)

This one is real cool, it has IP logging and a load of error scripts in it for verifying emails and other fields - check it out::

http://www.bigjolt.com/ [click on… “theLab”>“phpMailer”>“dnldZip”] **

cool thanks. i’ll try it out now and check the link. thanks:)