Question by Bri: Dreamweaver/Form Question – How do I add a form on a page to join a mailing list? I need to know the Action?
I’m able to build the form properly on the front end, so it appears correctly on the page. However, I don’t know what to put in for the action type. For method I have “post”. I want the data they enter into the field to be emailed to me, how do I put that into the “Action” section. Do I put something like “submit:myemailaddress@yahoo.com”?
Best answer:
Answer by Colanth
Action is the name of the file that does the actual work. It’s usually a PHP program, but it can be an ASP program if you run on a Microsoft server. You’d put something like “join.php” Then, in join.php, you’d have code that would take the data from the $ _POST[] variables (the text boxes and other controls you have on the form) and do what’s needed to “join” the user to the mailing list – add him to a database or send an email to the mailing list, send a confirmation email to the user, send him a “you have been added to the mailing list” page, etc.
Know better? Leave your own answer in the comments!

{ 1 comment… read it below or add one }
I’ve made up sample files before to answer the same question.
You can download the files one at a time
http://indranet.com/form/form.html
or all are in this zip
http://indranet.com/form/form.zip – includes the php and form reply file
You will need to change the php file, put in your email address and the Subject you want in the email you receive. Unless you are changing the form that’s the only change you need to make to the php file.
If you are going to add more fields to the form then just add (copy/paste/edit) in the php file a line, for example “n Email ” . $ _REQUEST['email'] .
Always make a copy of what works first.
You can delete the requirement for email address, it’s above in the form.html file. If you want to add more required fields to be filled out just copy/paste/edit the 5 lines starting with “if”
{ 5 trackbacks }