Creating a Mail Form with PHP and Flash - On to the PHP Code
(Page 6 of 7 )
Next we will turn our attention to our PHP file. Open up your favourite text editor or WYSIWYG program and copy this code
<?php $to = "you@yourdomain.com"; $msg = "$name\n\n"; $msg .= "$message\n\n"; mail($to, $subject, $msg, "From: My web site\nReply-To: $email\n"); ?> |
Again let's break down this code line by line.$to = "you@yourdomain.com";Here we are setting a variable with your e-mail address as it's value.$msg = "$name\n\n";$msg .= "$message\n\n";This is what will be displayed in the body of our e-mail.The variable name and message are defined in the flash filemail($to, $subject, $msg, "From: My web site\nReply-To: $email\n");mail() is a great function in PHP . It's syntax ismail("recipient", "subject" , "message", "mailheaders")The variable $subject and $email are also defined in the flash file Save your file as form.php
Next: Finishing it off >>
More Miscellaneous Articles
More By Codewalkers
|
| · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | | |
|