Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Email form in GoLive

Email form in GoLive
Thread Tools
Mac Elite
Join Date: Jan 2001
Location: .CL
Status: Offline
Reply With Quote
Jan 14, 2002, 06:03 PM
 
I am a webdesign newbie and i need to know a very basic thing.
I a making a wesbsite in GoLive 5. How can i a create a form that needs to be emailed?
I needs a few text fields (for name and comments) and a submit button (you see it's very simple) but what do i have to do to get it emailed?
A CGI script? How can i get a "send to mail" CGI script and how can that be linked in the form?
Should that CGI be in the same directory of the rest of the site or needs to be hosted specially?

I hope anyone can help with this stuff.
Thanks in advance.
     
Grizzled Veteran
Join Date: Jun 2001
Location: Melbourne, Australia
Status: Offline
Reply With Quote
Jan 14, 2002, 06:41 PM
 
Originally posted by ARENA:
<STRONG>I am a webdesign newbie and i need to know a very basic thing.
I a making a wesbsite in GoLive 5. How can i a create a form that needs to be emailed?
I needs a few text fields (for name and comments) and a submit button (you see it's very simple) but what do i have to do to get it emailed?
A CGI script? How can i get a "send to mail" CGI script and how can that be linked in the form?
Should that CGI be in the same directory of the rest of the site or needs to be hosted specially?

I hope anyone can help with this stuff.
Thanks in advance.</STRONG>
To celebrate my 100th posting (hurrah), here's a few tips:

There's a very commonly-used CGI called 'formmail.pl' that you can download from here. Essentially, it receives all the data from a form and converts it into 'label &gt; data' format for every parameter it receives.

So download that, and put it in the appropriate folder - if your ISP has instructed you to put it in a special CGI folder do that, or if you're running your own server then just create your own folder. I can't help with the specifics of getting Apache to run CGIs, though.

In GoLive, go to the form objects tab and drag across the 'form' container. Set the action to 'POST' and the target URL to the location where you've stored your formmail script.

Inside the new form container, you need to add two hidden form elements - the labels and values for these you will find in the formmail readme. They will be for the email address you want to send the form to, and extra handling parameters like a results page (a quick thankyou, for example) for the browser to redirect after the mail has been sent. There's quite a few parameters you can send if you want.

After this, you're free to add as many form elements as you want. Bear in mind, when you give each form element a name, that is what will appear in the email as a label - so if you had a textbox name of 'formnamefn' it might look a bit weird in your email. Giving each form name a plain english label will help a lot.

A tried and tested method is to create a two column table with as many rows as you need, putting text in the first column (name, address, email...) and the actual form elements in the second column - put one element per row to make your code easier to read. Then drag across a submit button (and a clear/reset button) into the last row in the second column.

Upload these to your live server and give it a whirl! Voila!

Any more specific detail you need? I'd be happy to help. Cheers
Computer thez nohhh...
     
ARENA  (op)
Mac Elite
Join Date: Jan 2001
Location: .CL
Status: Offline
Reply With Quote
Jan 14, 2002, 07:13 PM
 
Originally posted by Simon Mundy:
<STRONG>

To celebrate my 100th posting (hurrah), here's a few tips:

There's a very commonly-used CGI called 'formmail.pl' that you can download from here. Essentially, it receives all the data from a form and converts it into 'label &gt; data' format for every parameter it receives.

So download that, and put it in the appropriate folder - if your ISP has instructed you to put it in a special CGI folder do that, or if you're running your own server then just create your own folder. I can't help with the specifics of getting Apache to run CGIs, though.

In GoLive, go to the form objects tab and drag across the 'form' container. Set the action to 'POST' and the target URL to the location where you've stored your formmail script.

Inside the new form container, you need to add two hidden form elements - the labels and values for these you will find in the formmail readme. They will be for the email address you want to send the form to, and extra handling parameters like a results page (a quick thankyou, for example) for the browser to redirect after the mail has been sent. There's quite a few parameters you can send if you want.

After this, you're free to add as many form elements as you want. Bear in mind, when you give each form element a name, that is what will appear in the email as a label - so if you had a textbox name of 'formnamefn' it might look a bit weird in your email. Giving each form name a plain english label will help a lot.

A tried and tested method is to create a two column table with as many rows as you need, putting text in the first column (name, address, email...) and the actual form elements in the second column - put one element per row to make your code easier to read. Then drag across a submit button (and a clear/reset button) into the last row in the second column.

Upload these to your live server and give it a whirl! Voila!

Any more specific detail you need? I'd be happy to help. Cheers</STRONG>
Thanks a lot man!
I would try that tomorrow.
Is it possible to test the results using that script locally? O if not, can i test it with a mac.com website?
     
Grizzled Veteran
Join Date: Jun 2001
Location: Melbourne, Australia
Status: Offline
Reply With Quote
Jan 14, 2002, 07:19 PM
 
Originally posted by ARENA:
<STRONG>

Thanks a lot man!
I would try that tomorrow.
Is it possible to test the results using that script locally? O if not, can i test it with a mac.com website?</STRONG>
I don't know if mac.com supports CGI scripts. But you can test it on OS X if you have your server set up properly to accept CGIs and you have properly configured the sendmail daemon.

If both of those options draw a blank, I'm sure there's plenty of cheap (if not free) servers that will let you use scripting. In fact, I'm sure there was a thread on this somewhere recently.
Computer thez nohhh...
     
Fresh-Faced Recruit
Join Date: Jan 2002
Status: Offline
Reply With Quote
Jan 18, 2002, 08:00 AM
 
Originally posted by ARENA:
<STRONG>I am a webdesign newbie and i need to know a very basic thing.
I a making a wesbsite in GoLive 5. How can i a create a form that needs to be emailed?
I needs a few text fields (for name and comments) and a submit button (you see it's very simple) but what do i have to do to get it emailed?
A CGI script? How can i get a "send to mail" CGI script and how can that be linked in the form?
Should that CGI be in the same directory of the rest of the site or needs to be hosted specially?

I hope anyone can help with this stuff.
Thanks in advance.</STRONG>
In GoLive make sure your form action equals "mailto:foo@foo.com." E.g. &lt;form action="mailto:foo@foo.com" method="get" enctype="text/plain"&gt;. Foo will receive an email with each of the form element names followed by an equal sign and then the text entered in the form. E.g.
name=Bill address=Main Street. Not real pretty, but it works. CGI would only allow you to make it pretty or save it to a file. Good luck
     
ARENA  (op)
Mac Elite
Join Date: Jan 2001
Location: .CL
Status: Offline
Reply With Quote
Jan 18, 2002, 05:43 PM
 
Originally posted by bcathey:
<STRONG>

In GoLive make sure your form action equals "mailto:foo@foo.com." E.g. &lt;form action="mailto:foo@foo.com" method="get" enctype="text/plain"&gt;. Foo will receive an email with each of the form element names followed by an equal sign and then the text entered in the form. E.g.
name=Bill address=Main Street. Not real pretty, but it works. CGI would only allow you to make it pretty or save it to a file. Good luck</STRONG>
I didn't know it could be done without CGI. Thanks!
     
Professional Poster
Join Date: Oct 2000
Location: Toronto, ON
Status: Offline
Reply With Quote
Jan 18, 2002, 06:53 PM
 
Originally posted by bcathey:
<STRONG>In GoLive make sure your form action equals "mailto:foo@foo.com." E.g. &lt;form action="mailto:foo@foo.com" method="get" enctype="text/plain"&gt;.</STRONG>
bcathey is right on the money with this one.
I had a "guestbook" form with some pulldowns/multiple choices that did a mailto back to me. I then took the emails, saved them out as text, and processed them through a HyperCard stack to make the HTML page.

This was back in 1995! I'd get multiple submissions from people trying to figure out why their answers weren't showing up right away... Ah, youth...
The Lord said 'Peter, I can see your house from here.'
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:47 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2