hi all
I've written an FAQ for creating a flash form that does actually work. I've also tested it for flash 4 and 5 so there shouldn't be any compatibility complaints.
All the files discussed can be found at:
If it hasn't been screened and okayed in FAQ by the gurus here yet, then here it is in its glory:
_______________________________________________________
ok here we go:
What you need to know to format this form to your own requirements:
1] Making sure its sent to YOU
2] Adding/changing form input boxes
3] Amending the PHP to suit your new form.
First of all, the best thing to say about the labels and variables not discussed from here on is to just leave them be.
You could easily render the form useless just by tweaking a variable or a label somewhere within the movie. OK.......
1...Making sure its sent to you
In frame 1 of the movie, change the variable addressee to the e-mail address you want to receive the information.
i.e. if you want the form to be sent to jimmy@haggis.com then you change the action to Set Variable: "recipient" = "jimmy@haggis.com"
2...Adding/changing form input boxes
At the moment there are three text input boxes. The top two for 'topic' and 'contact address' are assigned the variables 'subj' and 'mail' respectively. The third 'comment' has the variable 'mess'.
You'll notice that these variables are used in two other places:
>Frame4 'back' button
>davform.php3 file
So, you guessed it, if you want to add more boxes to your form, just assign them variables and add them to the back button and the php3 file. This is easy for the back button because you can simply copy the format already in place.
However for the PHP file its similarly simple but you must be wary of how to do it or your form might fail........
3...Amending the PHP to suit your new form.
This is what the PHP file looks like (you can open it using Notepad):
<?php
mail($addressee, $subj, $mess,
"From:".$mail."\nReply-To:".$mail);
echo("sent=success"
;
?>
The first and last lines act similarly to HTML and ASP, they just let your server know that the script is PHP, so ignore them. The next line tells your server to send the form and all its components. It is this line which you have to amend.
For each additional box you add to the form, you must add the assigned variable to this line. Lets say that you add a box in your form asking for a phone number, you create a text-field in the movie and give it the variable name 'phone'. Then Line 2 of the PHP file would become:
mail($addressee, $subj, $mess, $phone,
So basically, you put a '$' before the new variable (make sure you put a comma after the last variable on this line!!.
And that's it!!! As I mentioned earlier, it would be a good idea for your sake if you left all labels and the undiscussed parts of the PHP well alone. These things are tender, and the slightest typo could ruin it completely (hence the countless entries in forums from people saying that their form doesn't work).
If this form doesn't work for you, the first thing you should do is contact your server and check if PHP can be used on their site. The chances are that your using a freebie server and it doesn't, so I suggest you hitch a ride to www.f2s.com and sign yourself up for a free site which allows PHP. As Oldnewbie pointed out, they don't give you a lot of webspace BUT you don't have to use this as your website host, you only have to use this to store your PHP files.
I hope this form helps everyone and I hate myself already for putting my own e-mail address in the example (should've put Old's in there LOL !!!).
If you are having problems, please don't e-mail me unless it critical, and please be patient if you do.
Cheers for now!!
dave ;-) davdesign@hotmail.com
^^^^^^^^^^^^^^^^
I've written an FAQ for creating a flash form that does actually work. I've also tested it for flash 4 and 5 so there shouldn't be any compatibility complaints.
All the files discussed can be found at:
If it hasn't been screened and okayed in FAQ by the gurus here yet, then here it is in its glory:
_______________________________________________________
ok here we go:
What you need to know to format this form to your own requirements:
1] Making sure its sent to YOU
2] Adding/changing form input boxes
3] Amending the PHP to suit your new form.
First of all, the best thing to say about the labels and variables not discussed from here on is to just leave them be.
You could easily render the form useless just by tweaking a variable or a label somewhere within the movie. OK.......
1...Making sure its sent to you
In frame 1 of the movie, change the variable addressee to the e-mail address you want to receive the information.
i.e. if you want the form to be sent to jimmy@haggis.com then you change the action to Set Variable: "recipient" = "jimmy@haggis.com"
2...Adding/changing form input boxes
At the moment there are three text input boxes. The top two for 'topic' and 'contact address' are assigned the variables 'subj' and 'mail' respectively. The third 'comment' has the variable 'mess'.
You'll notice that these variables are used in two other places:
>Frame4 'back' button
>davform.php3 file
So, you guessed it, if you want to add more boxes to your form, just assign them variables and add them to the back button and the php3 file. This is easy for the back button because you can simply copy the format already in place.
However for the PHP file its similarly simple but you must be wary of how to do it or your form might fail........
3...Amending the PHP to suit your new form.
This is what the PHP file looks like (you can open it using Notepad):
<?php
mail($addressee, $subj, $mess,
"From:".$mail."\nReply-To:".$mail);
echo("sent=success"
?>
The first and last lines act similarly to HTML and ASP, they just let your server know that the script is PHP, so ignore them. The next line tells your server to send the form and all its components. It is this line which you have to amend.
For each additional box you add to the form, you must add the assigned variable to this line. Lets say that you add a box in your form asking for a phone number, you create a text-field in the movie and give it the variable name 'phone'. Then Line 2 of the PHP file would become:
mail($addressee, $subj, $mess, $phone,
So basically, you put a '$' before the new variable (make sure you put a comma after the last variable on this line!!.
And that's it!!! As I mentioned earlier, it would be a good idea for your sake if you left all labels and the undiscussed parts of the PHP well alone. These things are tender, and the slightest typo could ruin it completely (hence the countless entries in forums from people saying that their form doesn't work).
If this form doesn't work for you, the first thing you should do is contact your server and check if PHP can be used on their site. The chances are that your using a freebie server and it doesn't, so I suggest you hitch a ride to www.f2s.com and sign yourself up for a free site which allows PHP. As Oldnewbie pointed out, they don't give you a lot of webspace BUT you don't have to use this as your website host, you only have to use this to store your PHP files.
I hope this form helps everyone and I hate myself already for putting my own e-mail address in the example (should've put Old's in there LOL !!!).
If you are having problems, please don't e-mail me unless it critical, and please be patient if you do.
Cheers for now!!
dave ;-) davdesign@hotmail.com
^^^^^^^^^^^^^^^^