This entry was posted on Wednesday, June 13th, 2007 at 7:00 pm and is filed under PHP Tutorials, Flash Tutorials. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
Webmaster Factor
Flash Tutorials and Web Development Blog
One of the most important parts of your site is your visitor’s ability to contact you. We could just throw our email address all over the site, but then we wouldn’t be able to give the customer a simple way of telling us what we need to know. That, and if your email address is all over the site, you will soon have to worry about spam. So, I will show you how to integrate those nifty PHP forms for your Flash sites…
It’s really quite simple.
Let’s go with 3 fields.
name.
email.
message.
You can add whatever you like, and if this does not explain it well enough,
go to my contact page and let me know, I will further learn ya, and build your page.
On the main stage for this page, choose text, now make sure that it’s input text.

Create three fields, I would not normally say put it all in one layer, but for this….do.
First and second fields should be thin, like so..

The third field should be a box, for a ‘message’. Like so…

Now highlight the first box and in the Properties window, you will see a field named Var.
In that window type ‘name’ like so…


Do the same for the next input field, but name the Var email.
For the large box, the name will be ‘message’, like so…


Now the submit button…
Ummm… same layer, still. Choose text (you get no image for this, it’s the big T in the tool bar)
type the word submit. It’s spelled S-U-B-M-I-T (no I am not making fun of you, I am just having fun..)
O.K., like this… (be sure to change your input text to static)


Now make a rectangle that will encompass (big word I just learned) all of “submit”. Hit F8 and make it
a button, change the alpha to 0.





Now set the clear button over the text “submit” like so…

Hit F9 and paste the following action script in:
on (release) {
getURL("sendmail.php", "_self", "POST");
}
Now…
Copy the following code in to notepad and save it as sendmail.php
You will probably understand this just by its set up, and how it works, if not, that’s fine
there are more tutorials to come and TIZAG.COM offers many tuts and asks
nothing in return (so if you are like me, and you get ok at this stuff, you better give them
props)
<?
$message = $_POST[’message’];
$email
= $_POST[’email’];
$name =
$_POST[’name’];
{
//send mail -
$subject & $contents
come from surfer
input
mail(”youremail@yourprovider.com “, “Website
Feedback”, “$name
sent
the following:\nEmail: $email\nMessage:
$message”, “From: feedback@website.com”);
//direct
to url
header(”Location: index.html”);
exit();
}
?>
That will do for today, grasshopper.
Leave a Reply
You must be logged in to post a comment.