Link to home
Start Free TrialLog in
Avatar of bick2000
bick2000

asked on

formMail.pl Form Submission Help

Hi!

ok, i need to create a form for my web site, and 1&1 says I need to use formMail.pl to do so. However, I use Frontpage 2003, and have no idea on how to send my forms to my e-mail. I can get the form designed (using simple HTML) but then what do i need to do to set up this formMail thing to send the form to my email?

I have downloaded the FormMail Compact from <http://nms-cgi.sourceforge.net/scripts.shtml> but I still am un able to figure out where I'm supposed to put the file, or how to set it up, or whatever I need to do. A detailed Explenation would be excellent, if possible!

Thank you so much for your help!

Bick
Avatar of venkateshwarr
venkateshwarr

keep the script on the server and post the form elements to the script.
what kind of server are u using?
Avatar of bick2000

ASKER

My web host is 1&1.com

What should i ask them, as far as the settings for the formMail file?

What do you mean about posting the form elements to the script. How do i set that up in the HTML... sorry for so many questions, I am just so new to all of this.

Also, what changes do i need to make to the FormMail script?

Thanks you.
I am not familiar with formMail, but based on the extension, I am assuming it is a perl script.
So your webhost must support scripts using perl.

You can ask them about this..

Regarding formmail, I found this link.. It will give you more details.
http://www.scriptarchive.com/formmail.html
formMail is targetted by spammers because it requires the destination email to be stored in a hidden variable. This allows them to get your email and sell it to all and sundry. They use automated "robots" to do this and scan millions of sites so don't think they won't stumble upon yours.

It is widely recommended that formMail should not be used. Not good news for newbies unfortunately because it forces you into server side programming. A simple contact form is not difficult however. I would recommend using PHP rather than Perl (but I'm biased). Let me know your preferred language and I can point you to some good examples.
I would recommend you to use the supported and enhanced FormMail.pl
It is also based on Matt's FormMail program, but these people called "The London Perl Mongers" were able to enhance the script including protecting your email address from spammers. The script is available at this URL. FAQ and Support are also available here. I just started using this script 2 weeks ago.

http://nms-cgi.sourceforge.net/
ASKER CERTIFIED SOLUTION
Avatar of calamaster
calamaster
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Great, thank you so much for your help calamaster, and everyone else. Right now, i just want to get it to work, then i will test out different scripts, but thank you for your input.

Ok, I got the file from my host and put it in a folder called cgi-bin, and copied this code. The for itself works great, and the submit button launched the FormMail.pl script. However, I am immedialty stoped with at "Error 500". I'm assuming, therefore, that it is a problem with the script. I ran 1&1's "Perl Script Checker" and got this response:

- cgi: File not executable (use chmod +x)
(no output)

I don't know where i need to go from here. I have set all the changes my host has said to the script, is there anything i need to review again? and what is "chmod" for?

THanks so much for all your help on this pesky problem.

Bick
BTW, as far as HTML, thats exactly what i was looking for calamaster, thanks!
i also ran 1&1's CGI Output Monitor, and it gave me this error:

- 126 CGI returned nonzero status
/usr/bin/nice: /kunden/homepages/28/d92615737/htdocs/./cgi-bin/FormMail.pl: Permission denied
STDOUT OK STDERR OK

Thank you for your help!
The problem is that the Host has not set the 'permissions' on the cgi-bin.FormMail.pl for you to use it yet.
Normally, th HOST pops it into either YOUR cgi-bin folder or somewhere else that you can't see.

Contact 1&1 and ask them:
1. have you put the FormMail.pl in the right place
2. have they set 'Permissions' on it (CHMOD 777 I think)

Further to last reply. I see that 1&1 are a eShop hoster that give you a load of configuration options for you website.

From: www.1and1.co.uk homepage
got to FAQ (top right)
then ADVANCED SCRIPTING FUNCTIONS
then CGI OPTIONS
then 'How do I create a Feedback form using the standard CGIs'

Here there is a tutorial on how to configure a FORM on your webspace in your eShop.

OK

Ok, ill ask them, but they take a while to respond to my e-mail! :)

Yeah, i tried using one of their forms, but hated it, because i need something just a little more custom.

What do I have to do about "Permissions"? or will they tell me that?

Thanks!
Will this help my problem at all? and what do i change?       

[Why aren't the scripts in /cgi-bin not working?

The standard configuration redirects the cgi-bin directory on every customer home directory to /var/www/cgi-bin. For this reason the webserver can't find the scripts in the cgi-bin directory of your customer home directory. You can solve this problem either by renaming the directory or by deactivating the redirection in the apache configuration /etc/httpd/conf/httpd.conf as follows:

# ScriptAlias /cgi-bin/ "/var/www/cgi-bin/" ]

Thanks!
Sorry for posting again, but I found this, and it has to do with setting permissions, but its greek to me... is this something that I can change? (or need to?)

Thank you!

Please note: Perl scripts can only be executed if .pl is the file extension and the first line of the script starts with #! /usr/bin/perl.

Perl scripts must be transferred in ASCII mode and the file permissions must be set as follows:
Owner: Read, Write, Execute
Group: -
Other: Read, Execute
(chmod 705)

"Normal" web page file permissions should be chmod 604.
Owner: Read, Write,
Group: -
Other: Read
It looks like the cgi-bin folder is in the root Host 'Home directory' tree and you do not have a different one for each of the eShops they host. I assume 1&1 therefore share infrastructure across all their hosted eShops??  I don't know how 1&1 set up the sub-shops within their hosting environment, ask them.

So this means that it is NOT at www.yourshop.com/cgi-bin.

So I think you need to set the Action of the web Form as follows:

<form name="detailsForm" method="post" action="../var/www/cgi-bin/FormMail.pl">

Now I am not 100% sure of this but I think you get the general Idea. You need to send the above line to 1&1 to chck just what the path is.

I see that 1&1 sub eShops have URLS http:\\www.oneandone.co.uk\yourshop.com

If the above is true then the 'Permissions' will have already been set for you to use. (CHMOD 705)

I'll have another look through 1and1 but as I am not a customer I get limited viewing of their set up.


Further to the above:
I have found a configuration script on 1and1 FAQ for the FormMail.pl

From: www.1and1.co.uk homepage
got to FAQ (top right)
then ADVANCED SCRIPTING FUNCTIONS
then FORMMAIL.PL
then Look through all these solutions. One has a completed configuration.

All you do is change your version as specified and load it up....To where is not very clear though, so check with 1and1.

When you load it up via FTP make sure use set the 'Permission' correctly in your FTP program as specified.

If you get an error when you try to fire it up then check the error message. Most errors are caused by incorrect 'Hidden' field names or configuration entries. These ARE case sensitive.
One more thing though. You said earlier that you used one of their custom forms already

>>Yeah, i tried using one of their forms, but hated it, because i need something just a little more custom.<<

Why not just edit the HTML in the one you created to add more / less fields as required?

<tr>
<td align="right">Mother's Maiden Name</td>
<td><input type="text" name="motherName" value="" size="29"></td>
</tr>

<tr>
<td align="right">Favourite Colour</td>
<td>
<select name="FavColour">
<option value="">Please select</option>
<option value="BL">Blue</option>
<option value="GRN">Green</option>
<option value="RD">Red</option>
<option value="OR">Orange</option>
<option value="Other">--Other--</option>
</select>
</td>
</tr>
Ok, thank you so much! You've helped me enough that I should stop taking your time and just give you the points! :)

Thanks again! I'll talk to 1&1 and get the rest worked out!

Thanks,

Bick
Thanks for the points.
Hope you get it sorted.

Calamaster